File Opening Method and Device

ABSTRACT

This application relates to a file opening method and a device. A first device displays a first interface, and projects the first interface onto a second interface of a second device, where the first interface includes at least one file icon, the second interface includes the first interface, and a file corresponding to the at least one file icon is stored in the first device. The first device detects an operation performed on the file icon. When the file icon is an icon displayed on the first interface, the first device invokes a first application to open the file; or when the file icon is an icon displayed on the second interface, the first device sends metadata of the file to the second device, where the metadata of the file is used to open the file on the second device.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a National Stage of International Application No.PCT/CN2021/103515, filed on Jun. 30, 2021, which claims priority toChinese Patent Application No. 202010648535.5, filed on Jul. 7, 2020,all of which are hereby incorporated by reference in their entireties.

TECHNICAL FIELD

This application relates to the field of communication technologies, andin particular, to a file opening method and a device.

BACKGROUND

With development of intelligent terminals, there are more and morescenarios in which one user has a plurality of intelligent terminals,for example, devices such as a smartphone, a tablet computer (PAD), anda personal computer (PC). The interconnection between a plurality ofdevices brings good user experience.

Currently, to improve user experience, a multi-screen collaborationfunction (or referred to as a multi-device collaboration function) isprovided. With the multi-screen collaboration function, a file on onedevice can be opened on another device. For example, if a mobile phoneand a PC perform multi-screen collaboration, a display interface of themobile phone is displayed on a display of the PC, and the displayinterface of the mobile phone displayed on the PC may also be understoodas a projection interface. A user performs an operation on theprojection interface on the PC. For example, the user chooses to open afile A. In this case, the file A may be opened on the PC. Alternatively,the user performs an operation on the mobile phone. For example, theuser chooses to open a file B. Similarly, the file B may be opened onthe PC but not the mobile phone. Compared with the mobile phone, the PChas a larger display area. The user can view the file on the PC toimprove a viewing effect.

It can be learned that in a multi-screen collaboration scenario,regardless of which device a user performs an operation on, a responseis made on one of the devices participating in multi-screencollaboration. For example, during the multi-screen collaborationbetween the mobile phone and the PC, regardless of whether a userperforms an operation on the mobile phone or the PC to open a file, thefile is opened on the PC but not on the mobile phone. However, if theuser actually wants to view the file on the mobile phone, this cannot beimplemented in the current manner. The user can normally open and viewcorresponding content on the mobile phone only after exiting themulti-screen collaboration mode. However, this process requires aplurality of steps, which is complex.

SUMMARY

Embodiments of this application provide a file opening method and adevice, to simplify a file opening procedure.

According to a first aspect, a file opening method is provided. Themethod includes: A first device and a second device enter a multi-screencollaboration mode in a preset manner. The first device displays a firstinterface and projects the first interface onto a second interface ofthe second device, where the first interface includes at least one fileicon, the second interface includes the first interface, and a filecorresponding to the at least one file icon is stored in the firstdevice. The first device detects an operation performed on the fileicon. The first device determines whether the operation is performed ona display of the first device or a display of the second device. Whenthe operation is performed on the display of the first device, the firstdevice invokes a first application to open the file; or when theoperation is performed on the display of the second device, the firstdevice sends metadata of the file to the second device, where themetadata of the file is used to open the file on the second device.

The method may be performed by the first device. The first device is,for example, a mobile device such as a mobile phone, a tablet computer(PAD), or a portable computer. Alternatively, the first device may be adevice at a fixed location, for example, a desktop computer at a fixedlocation.

The first device performs projection onto the second device. In acurrent manner, a user performs an operation on the first device to opena corresponding file, and the file should be opened on the seconddevice. However, in this embodiment of this application, if the firstdevice detects that a user performs an operation on the display of thefirst device, the file can be locally opened on the first device but noton the second device. If the user performs an operation on the displayof the first device, it indicates that the user may use the first devicecurrently, and it is clearly that opening the file on the first deviceis more convenient for the user to view. In the manner provided in thisembodiment of this application, because the file can be opened on thefirst device, the user does not need to exit the multi-screencollaboration mode, and naturally does not need to perform a pluralityof steps. This simplifies a file opening procedure, reduces a quantityof response times of a device, and helps reduce power consumption of thedevice. In addition, if the first device determines that the userperforms an operation on the display of the second device, the file canalso be opened on the second device. That is, according to the methodprovided in this embodiment of this application, a current focus ofattention of the user can be determined based on a user operation, sothat a corresponding device is selected to open a file. This is moreconducive to viewing of the user, and avoids excessive operation stepsof the user.

In a possible implementation, the method further includes:

The first device receives an updated file from the second device, wherethe updated file is the first file that is updated.

The first device updates the locally stored file with the updated file.

If the file is opened on the second device, the user may perform anediting operation on the file on the second device. For example, theuser may modify the file. After the user performs the editing operationon the file, a modified file may be stored on the second device, and themodified file is, for example, referred to as an updated file. Thesecond device may send the updated file to the first device, and thefirst device may update the original file stored in the first devicewith the updated file. In this way, the file is updated.

In a possible implementation, that the first device detects an operationperformed on the file icon includes:

The first device receives event information from the second device,where the event information is used to indicate the operation, and theevent information includes an identifier of the second device.

If the user performs an operation on the display of the first device,the first device can directly collect the operation of the user, or inother words, the first device can capture an operation event of theuser. Therefore, if the first device can collect the operation of theuser, it can be determined that the operation is performed on thedisplay of the first device. If the user performs an operation on thedisplay of the second device, the first device cannot directly collectthe operation of the user, but the second device may collect theoperation of the user. In other words, the second device can capture anoperation event of the user to obtain event information corresponding tothe operation event, and the second device can send the eventinformation to the first device. The event information may indicate theoperation, or in other words, the event information may describe theoperation. The event information may include an identifier of the seconddevice, to indicate that an operation corresponding to the eventinformation is performed on the second device.

In a possible implementation, that the first device determines that theoperation is performed on the display of the second device includes:

The first device determines, based on the identifier of the seconddevice, that the operation is performed on the display of the seconddevice.

For example, the event information may include the identifier of thesecond device, so that the first device can determine, after obtainingthe event information, that the operation is performed on the display ofthe second device. Optionally, the event information may further includeinformation such as relative position coordinates of the operation onthe first interface displayed on the second device, so that the firstdevice can determine a file corresponding to the operation of the user.In this manner, the first device can determine an operation focus of theuser, to select a device on which the file is to be opened.

In a possible implementation, that the first device sends metadata ofthe file to the second device includes:

The first device synchronizes (or sends) the metadata of the file to adistributed file system of the second device by using a distributed filesystem of the first device.

The distributed file system may be set on both the first device and thesecond device. For example, the distributed file system may be used tomanage a file, and some information related to the file can besynchronized between the first device and the second device by using thedistributed file system. Therefore, the first device can synchronize themetadata of the file by using the distributed file system. Certainly,the first device may also send the metadata of the file to the seconddevice in another manner. This is not specifically limited.

In a possible implementation, before the first device invokes the firstapplication to open the file, the method further includes:

The first device outputs prompt information, where the promptinformation includes one or more options, and the one or more optionsare used to determine a device on which the file is to be opened.

The first device detects an operation of selecting a first option in theone or more options, where the first option corresponds to the firstapplication.

In other words, even if the first device determines that the userperforms an operation on the display of the first device, the firstdevice can still output the prompt information, so that the user selectsa device on which the file is to be opened. If the user chooses to openthe file on the first device, the file is opened on the first deviceaccording to the selection of the user. In this manner, a device onwhich the file is opened better meets a requirement of the user, andthis is more conducive to viewing of the user.

In a possible implementation,

the first device outputs prompt information when the operation isperformed on the display of the first device, where the promptinformation includes one or more options, and the one or more optionsare used to determine a device on which the file is to be opened.

The first device detects an operation of selecting a second option inthe one or more options, where the second option is used to indicate toopen the file on the second device.

The first device sends the metadata of the file to the second device,where the metadata of the file is used to open the file on the seconddevice.

Even if the first device determines that the user performs an operationon the display of the first device, the first device can still outputthe prompt information, so that the user selects a device on which thefile is to be opened. If the user chooses to open the file on the seconddevice, the file is opened on the second device according to theselection of the user. For example, sometimes although the user performsan operation on the first device, the user actually expects to present acorresponding file on the second device to another user for viewing. Inthis scenario, according to the technical solution provided in thisembodiment of this application, the user may choose to open the file ona portable computer, so as to complete a presentation process. It can belearned that according to the technical solution provided in thisembodiment of this application, a selection opportunity is provided forthe user, and it is more convenient for the user to select a properdevice to open a corresponding file.

In a possible implementation, the metadata of the file includes storagepath information of the file in the first device.

The metadata of the file may include the storage path information of thefile in the first device, so that after obtaining the metadata of thefile, the second device can obtain the file from the first device basedon the storage path information, to locally open the file on the seconddevice.

In a possible implementation, the metadata of the file further includesone or more of the following: type information of the file, sizeinformation of the file, or a name of the file.

In addition to the storage path information of the file in the firstdevice, the metadata of the file may further include other information,for example, the type information of the file or the size information ofthe file, so that the second device can obtain more information aboutthe file.

According to a second aspect, a second communication method is provided.The method includes: A first device and a second device enter amulti-screen collaboration mode in a preset manner. The first devicedisplays a first interface and projects the first interface onto asecond interface of the second device, where the first interfaceincludes at least one file icon, the second interface includes the firstinterface, and a file corresponding to the at least one file icon isstored in the first device. The first device detects an operationperformed on the file icon. When the file icon is an icon displayed onthe first interface of the first device, the first device invokes afirst application to open the file; or when the file icon is an icondisplayed on the second interface, the first device sends metadata ofthe file to the second device, where the metadata of the file is used toopen the file on the second device.

The method may be performed by the first device. The first device is,for example, a mobile device such as a mobile phone, a tablet computer,or a portable computer. Alternatively, the first device may be a deviceat a fixed location, for example, a desktop computer at a fixedlocation.

In a possible implementation, the method further includes:

The first device receives an updated file from the second device, wherethe updated file is the file that is updated.

The first device updates the locally stored file with the updated file.

In a possible implementation, that the first device detects an operationperformed on the file icon includes:

The first device receives event information from the second device,where the event information is used to indicate the operation, and theevent information includes an identifier of the second device; or

the first device detects, on the first device, event informationgenerated by the operation.

That the first device detects, on the first device, the eventinformation generated by the operation may be understood as: The firstdevice detects the operation on the first device, and obtains the eventinformation corresponding to the operation. Therefore, it may beconsidered that the first device detects, on the first device, the eventinformation generated by the operation, or it may be understood that thefirst device detects, on the first device, the event informationcorresponding to the operation. That is, the former understanding isthat the first device detects the operation and obtains the eventinformation, and the latter understanding is that the first devicedetects the event information, where the event information correspondsto the operation.

In a possible implementation, that the first device determines that thefile icon is an icon displayed on the second interface includes:

The first device determines, based on the identifier of the seconddevice, that the file icon is an icon displayed on the second interface.

In a possible implementation, that the first device sends metadata ofthe file to the second device includes:

The first device sends the metadata of the file to a distributed filesystem of the second device by using a distributed file system of thefirst device.

In a possible implementation, before the first device invokes the firstapplication to open the file, the method further includes:

The first device outputs prompt information, where the promptinformation includes one or more options, and the one or more optionsare used to determine a device on which the file is to be opened.

The first device detects an operation of selecting a first option in theone or more options, where the first option corresponds to the firstapplication.

In a possible implementation, the method further includes:

The first device outputs prompt information when the file icon is anicon displayed on the first interface, where the prompt informationincludes one or more options, and the one or more options are used todetermine a device on which the file is to be opened.

The first device detects an operation of selecting a second option inthe one or more options, where the second option is used to indicate toopen the file on the second device.

The first device sends the metadata of the file to the second device,where the metadata of the file is used to open the file on the seconddevice.

In a possible implementation, the metadata of the file includes storagepath information of the file in the first device.

In a possible implementation, the metadata of the file further includesone or more of the following: type information of the file, sizeinformation of the file, or a name of the file.

For technical effects brought by the second aspect or the possibleimplementations of the second aspect, refer to the descriptions of thetechnical effects brought by the first aspect or the correspondingimplementations.

According to a third aspect, an electronic device is provided. Theelectronic device includes a display, one or more processors, a memory,and one or more programs. The one or more programs are stored in thememory, the one or more programs include instructions, and when theinstructions are executed by the electronic device, the electronicdevice is enabled to perform the method according to any one of thefirst aspect or the possible implementations of the first aspect, or theelectronic device is enabled to perform the method according to any oneof the second aspect or the possible implementations of the secondaspect.

According to a fourth aspect, an electronic device is provided. Theelectronic device includes a module/unit configured to perform themethod according to any one of the first aspect or the possibleimplementations of the first aspect, or the electronic device includes amodule/unit configured to perform the method according to any one of thesecond aspect or the possible implementations of the second aspect.

According to a fifth aspect, a computer-readable storage medium isprovided. The computer-readable storage medium stores a computerprogram. When the computer program is run on a computer, the computer isenabled to perform the method according to any one of the first aspector the possible implementations of the first aspect, or the computer isenabled to perform the method according to any one of the second aspector the possible implementations of the second aspect.

According to a sixth aspect, a computer program product includinginstructions is provided. The computer program product is configured tostore a computer program. When the computer program is run on acomputer, the computer is enabled to perform the method according to anyone of the first aspect or the possible implementations of the firstaspect, or the computer is enabled to perform the method according toany one of the second aspect or the possible implementations of thesecond aspect.

According to a seventh aspect, a communications system is provided. Thecommunications system includes the electronic device according to thethird aspect, or includes the electronic device according to the fourthaspect.

In an optional implementation, the communications system furtherincludes a second device, and the second device is the second deviceaccording to the first aspect or the implementations, or the seconddevice according to the second aspect or the implementations.

According to the method provided in embodiments of this application, acurrent focus of attention of the user can be determined based on a useroperation, so that a corresponding device is selected to open a file.This is more conducive to viewing of the user, and avoids excessiveoperation steps of the user.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic diagram of a structure of an electronic device;

FIG. 2 is a schematic diagram of a current process of opening a file ina multi-screen collaboration mode;

FIG. 3A is a schematic diagram of a home screen of a mobile phoneaccording to an embodiment of this application;

FIG. 3B is a schematic diagram in which a user touches a portablecomputer by using a mobile phone according to an embodiment of thisapplication;

FIG. 3C is a schematic diagram of displaying a mirror of a mobile phoneon a portable computer in a multi-screen collaboration mode according toan embodiment of this application;

FIG. 4A is a schematic diagram in which a user performs a firstoperation on a projection interface 202 displayed on a portable computeraccording to an embodiment of this application;

FIG. 4B is a schematic diagram of opening a file 3 on a portablecomputer according to an embodiment of this application;

FIG. 4C is another schematic diagram of opening a file 3 on a portablecomputer according to an embodiment of this application;

FIG. 4D is still another schematic diagram of opening a file 3 on aportable computer according to an embodiment of this application;

FIG. 5A is a schematic diagram in which a user performs a secondoperation on a mobile phone 100 according to an embodiment of thisapplication;

FIG. 5B is a schematic diagram of opening a file 3 on a mobile phone 100according to an embodiment of this application;

FIG. 6 is a schematic diagram of a process of opening a file in amulti-screen collaboration mode according to an embodiment of thisapplication;

FIG. 7A is a schematic diagram of displaying prompt information on amobile phone 100 according to an embodiment of this application;

FIG. 7B is a schematic diagram in which a user performs an operation onan option included in prompt information according to an embodiment ofthis application;

FIG. 7C is another schematic diagram of displaying prompt information ona mobile phone 100 according to an embodiment of this application;

FIG. 7D is another schematic diagram in which a user performs anoperation on an option included in prompt information according to anembodiment of this application;

FIG. 8A and FIG. 8B are a flowchart of a first file opening methodaccording to an embodiment of this application;

FIG. 9A and FIG. 9B are a flowchart of a second file opening methodaccording to an embodiment of this application; and

FIG. 10 is a schematic diagram of a structure of an electronic deviceaccording to an embodiment of this application.

DETAILED DESCRIPTION OF ILLUSTRATIVE EMBODIMENTS

To make objectives, technical solution, and advantages of embodiments ofthis application clearer, the following further describes embodiments ofthis application in detail with reference to the accompanying drawings.

The following describes some terms in embodiments of this application,to facilitate understanding of a person skilled in the art.

An application (application, app) in this application is a softwareprogram that can implement one or more specific functions. Usually, aplurality of applications may be installed on an electronic device, forexample, a Camera application, a Messages application, a multimediamessage application, an image application, various Email applications,WeChat (WeChat), WhatsApp Messenger, Line (Line), Instagram (instagram),or Kakao Talk. The application in the following may be an applicationinstalled when the electronic device is delivered from a factory, or maybe an application (for example, an application sent by anotherelectronic device) downloaded by a user from a network or obtained fromanother electronic device in a process of using the electronic device.

A file in this application is, for example, a multimedia file such as animage file, a video file, or an audio file, or may be a text file, forexample, a Microsoft (Microsoft) Office (office) file such as a Wordfile, an Excel file, or a PowerPoint file; or may be a picture file suchas a Microsoft Office Visio file or a Photoshop file corresponding to adrawing application.

In embodiments of this application, “at least one” means one or more,and “a plurality of” means two or more. A term “and/or” describes anassociation relationship between associated objects and indicates thatthere may be three relationships. For example, A and/or B may representthe following three cases: Only A exists, both A and B exist, and only Bexists, where A and B may be singular or plural. The character “/”usually represents an “or” relationship between the associated objects.“At least one of the following” or a similar expression indicates anycombination of the items, and includes any combination of singular itemsor plural items. For example, at least one of a, b, or c may indicate:a, b, c, a and b, a and c, b and c, or a, b, and c, where a, b, and cmay be singular or plural.

In addition, unless otherwise stated, in embodiments of thisapplication, ordinal numbers such as “first” and “second” are intendedto distinguish between a plurality of objects, but are not intended tolimit sizes, content, orders, time sequences, priorities, importance, orthe like of the plurality of objects. For example, a second file and asecond file are merely used to distinguish between different files, butdo not indicate different sizes, content, priorities, importance, or thelike of the two files.

The technical solutions provided in this application may be applied toan electronic device. The following describes an electronic device, agraphical user interface (graphical user interface, GUI) used for theelectronic device, and embodiments used for using the electronic device.In some embodiments of this application, the electronic device may be aportable electronic device, such as a mobile phone, a PAD, a portablecomputer, a wearable device (such as a smartwatch, smart glasses, asmart band, or a smart helmet) with a wireless communication function,or a vehicle-mounted device. An example embodiment of the portableelectronic device includes but is not limited to a portable electronicdevice using iOS®, Android®, Microsoft®, or another operating system. Itshould be further understood that in some other embodiments of thisapplication, the electronic device may not be a portable device, but adesktop computer such as a PC that can collect an image and run an imagecompression algorithm to compress the image.

For example, FIG. 1 is a schematic diagram of a structure of anelectronic device 100.

It should be understood that the electronic device 100 shown in thefigure is merely an example, and the electronic device 100 may have moreor fewer components than those shown in the figure, may combine two ormore components, or may have different component configurations. Variouscomponents shown in the figure may be implemented in hardware, software,or a combination of hardware and software that includes one or moresignal processing and/or application-specific integrated circuits.

As shown in FIG. 1 , the electronic device 100 may include a processor110, an external memory interface 120, an internal memory 121, auniversal serial bus (universal serial bus, USB) interface 130, acharging management module 140, a power management module 141, a battery142, an antenna 1, an antenna 2, a mobile communications module 150, awireless communications module 160, an audio module 170, a speaker 170A,a receiver 170B, a microphone 170C, a headset jack 170D, a sensor module180, a button 190, a motor 191, an indicator 192, a camera 193, adisplay 194, a subscriber identification module (subscriberidentification module, SIM) card interface 195, and the like. The sensormodule 180 may include a pressure sensor 180A, a gyroscope sensor 180B,a barometric pressure sensor 180C, a magnetic sensor 180D, anacceleration sensor 180E, a distance sensor 180F, an optical proximitysensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, atouch sensor 180K, an ambient light sensor 180L, a bone conductionsensor 180M, and the like.

The following specifically describes each part of the electronic device100 with reference to FIG. 1 .

The processor 110 may include one or more processing units. For example,the processor 110 may include an application processor (applicationprocessor, AP), a modem processor, a graphics processing unit (graphicsprocessing unit, GPU), an image signal processor (image signalprocessor, ISP), a controller, a memory, a video codec, a digital signalprocessor (digital signal processor, DSP), a baseband processor, aneural-network processing unit (neural-network processing unit, NPU),and/or the like. Different processing units may be independentcomponents, or may be integrated into one or more processors. Thecontroller may be a nerve center and a command center of the electronicdevice 100. The controller may generate an operation control signalbased on instruction operation code and a time sequence signal, tocomplete control of instruction reading and instruction execution.

A memory may be further disposed in the processor 110, and is configuredto store instructions and data. In some embodiments, the memory in theprocessor 110 is a cache. The memory may store instructions or data justused or cyclically used by the processor 110. If the processor 110 needsto use the instructions or the data again, the processor 110 maydirectly invoke the instructions or the data from the memory, to avoidrepeated access and reduce a waiting time of the processor 110.Therefore, system efficiency can be improved.

The processor 110 may run the file opening method provided inembodiments of this application. For example, embodiments of thisapplication provide manager software. The manager software may be asoftware module, the software module may run on the processor 110, andthe software module may be understood as a computer program. For anotherexample, embodiments of this application further provide projectionsoftware. The projection software may be a software module, the softwaremodule may run on the processor 110, and the software module may beunderstood as a computer program. The manager software and theprojection software may be a same software module, or the managersoftware and the projection software may be different software modules.In addition, the manager software may be software that runsindependently, or may be a part of system software. Similarly, theprojection software may be software that runs independently, or may be apart of system software. When different components are integrated in theprocessor 110, for example, a CPU and a GPU are integrated, the CPU andthe GPU may cooperate to perform the method provided in embodiments ofthis application. For example, in the method provided in embodiments ofthis application, some algorithms are performed by the CPU, and theother algorithms are performed by the GPU, to obtain fast processingefficiency.

In some embodiments, the processor 110 may include one or moreinterfaces. For example, the interface may include an inter-integratedcircuit (inter-integrated circuit, I2C) interface, an inter-integratedcircuit sound (inter-integrated circuit sound, I2S) interface, a pulsecode modulation (pulse code modulation, PCM) interface, a universalasynchronous receiver/transmitter (universal asynchronousreceiver/transmitter, UART) interface, a mobile industry processorinterface (mobile industry processor interface, MIPI), a general-purposeinput/output (general-purpose input/output, GPIO) interface, asubscriber identity module (subscriber identity module, SIM) interface,a universal serial bus (universal serial bus, USB) interface, and/or thelike.

A wireless communication function of the electronic device 100 may beimplemented through the antenna 1, the antenna 2, the mobilecommunications module 150, the wireless communications module 160, themodem processor, the baseband processor, and the like. The antenna 1 andthe antenna 2 are configured to transmit and receive an electromagneticwave signal. Each antenna in the electronic device 100 may be configuredto cover one or more communication bands. Different antennas may befurther multiplexed, to improve antenna utilization. For example, theantenna 1 may be multiplexed as a diversity antenna of a wireless localarea network. In some other embodiments, the antenna may be used incombination with a tuning switch.

The mobile communications module 150 may provide a wirelesscommunication solution that includes 2G/3G/4G/5G or the like and that isapplied to the electronic device 100. The mobile communications module150 may include at least one filter, a switch, a power amplifier, a lownoise amplifier (low noise amplifier, LNA), and the like. The mobilecommunications module 150 may receive an electromagnetic wave throughthe antenna 1, perform processing such as filtering or amplification onthe received electromagnetic wave, and transmit the electromagnetic waveto the modem processor for demodulation. The mobile communicationsmodule 150 may further amplify a signal modulated by the modemprocessor, and convert an amplified signal into an electromagnetic wavethrough the antenna 1 for radiation. In some embodiments, at least somefunction modules of the mobile communications module 150 may be disposedin the processor 110. In some embodiments, at least some functionmodules of the mobile communications module 150 may be disposed in asame device as at least some modules of the processor 110.

The wireless communications module 160 may provide a wirelesscommunication solution that is applied to the electronic device 100 andthat includes a wireless local area network (wireless local areanetworks, WLAN) (for example, a wireless fidelity (wireless fidelity,Wi-Fi) network), Bluetooth (Bluetooth, BT), a global navigationsatellite system (global navigation satellite system, GNSS), frequencymodulation (frequency modulation, FM), a near field communication (nearfield communication, NFC) technology, and an infrared (infrared, IR)technology. The wireless communications module 160 may be one or morecomponents integrating at least one communications processor module. Thewireless communications module 160 receives an electromagnetic wave bythe antenna 2, performs frequency modulation and filtering processing onan electromagnetic wave signal, and sends a processed signal to theprocessor 110. The wireless communications module 160 may furtherreceive a to-be-sent signal from the processor 110, perform frequencymodulation and amplification on the signal, and convert the signal intoan electromagnetic wave for radiation through the antenna 2.

In some embodiments, in the electronic device 100, the antenna 1 and themobile communications module 150 are coupled, and the antenna 2 and thewireless communications module 160 are coupled, so that the electronicdevice 100 can communicate with a network and another device by using awireless communications technology. The wireless communicationstechnology may include a global system for mobile communications (globalsystem for mobile communications, GSM), a general packet radio service(general packet radio service, GPRS), code division multiple access(code division multiple access, CDMA), wideband code division multipleaccess (wideband code division multiple access, WCDMA), time-divisioncode division multiple access (time-division code division multipleaccess, TD-SCDMA), long term evolution (long term evolution, LTE), BT, aGNSS, a WLAN, NFC, FM, an IR technology, and/or the like. The GNSS mayinclude a global positioning system (global positioning system, GPS), aglobal navigation satellite system (global navigation satellite system,GLONASS), a BeiDou navigation satellite system (BeiDou navigationsatellite system, BDS), a quasi-zenith satellite system (quasi-zenithsatellite system, QZSS), and/or satellite based augmentation systems(satellite based augmentation systems, SBAS).

It may be understood that an interface connection relationship betweenmodules illustrated in embodiments of this application is merely anexample for description, and does not constitute a limitation on thestructure of the electronic device 100. In some other embodiments ofthis application, the electronic device 100 may alternatively use aninterface connection manner different from that in the foregoingembodiment, or use a combination of a plurality of interface connectionmanners.

The electronic device 100 implements a display function by using theGPU, the display 194, the application processor, and the like. The GPUis a microprocessor for image processing, and is connected to thedisplay 194 and the application processor. The GPU is configured toperform mathematical and geometric computation, and render an image. Theprocessor 110 may include one or more GPUs that execute programinstructions to generate or change display information.

The display 194 is configured to display an image, a video, and thelike. The display 194 includes a display panel. The display panel may bea liquid crystal display (liquid crystal display, LCD), an organiclight-emitting diode (organic light-emitting diode, OLED), anactive-matrix organic light emitting diode (active-matrix organic lightemitting diode, AMOLED), a flexible light-emitting diode (flexlight-emitting diode, FLED), a mini-LED, a micro-LED, a micro-OLED, aquantum dot light emitting diode (quantum dot light emitting diodes,QLED), or the like.

The electronic device 100 may implement a photographing function or animage capture function by using the camera 193, the ISP, the videocodec, the GPU, the display 194, the application processor, and thelike.

The ISP may be configured to process data fed back by the camera 193.For example, during photographing, a shutter is pressed, and light istransmitted to a photosensitive element of the camera through a lens. Anoptical signal is converted into an electrical signal, and thephotosensitive element of the camera transmits the electrical signal tothe ISP for processing, to convert the electrical signal into a visibleimage. The ISP may further perform algorithm optimization on noise,brightness, and complexion of the image. The ISP may further optimizeparameters such as exposure and a color temperature of a photographingscenario. In some embodiments, the ISP may be disposed in the camera193.

The camera 193 may be configured to capture a static image or a video.An optical image of an object is generated through the lens, and isprojected onto the photosensitive element. The photosensitive elementmay be a charge-coupled device (charge coupled device, CCD) or acomplementary metal-oxide-semiconductor (complementarymetal-oxide-semiconductor, CMOS) photoelectric transistor. Thelight-sensitive element converts an optical signal into an electricalsignal, and then transmits the electrical signal to the ISP to convertthe electrical signal into a digital image signal. The ISP outputs thedigital image signal to the DSP for processing. The DSP converts thedigital image signal into a standard image signal in a format such asRGB or YUV. In some embodiments, the electronic device 100 may includeone or N cameras 193, where N is a positive integer greater than 1.

The digital signal processor is configured to process a digital signal,and may process another digital signal in addition to the digital imagesignal. For example, when the electronic device 100 selects a frequency,the digital signal processor is configured to perform Fouriertransformation on frequency energy.

The video codec is configured to compress or decompress a digital video.The electronic device 100 may support one or more video codecs. In thisway, the electronic device 100 may play back or record videos in aplurality of coding formats, for example, moving picture experts group(moving picture experts group, MPEG)-1, MPEG-2, MPEG-3, and MPEG-4.

The NPU is a neural-network (neural-network, NN) computing processor,quickly processes input information by referring to a structure of abiological neural network, for example, by referring to a mode oftransfer between human brain neurons, and may further continuouslyperform self-learning. Applications such as intelligent cognition of theelectronic device 100 may be implemented through the NPU, for example,image recognition, facial recognition, speech recognition, and textunderstanding.

The internal memory 121 may be configured to store computer-executableprogram code, and the executable program code includes instructions. Theinternal memory 121 may include a program storage area and a datastorage area. The program storage area may store an operating system, anapplication required by at least one function (for example, a voiceplaying function or an image playing function), and the like. The datastorage area may store data (such as audio data and an address book)created during use of the electronic device 100, and the like. Inaddition, the internal memory 121 may include a high-speed random accessmemory, or may include a nonvolatile memory, for example, at least onemagnetic disk storage device, a flash memory, or a universal flashstorage (universal flash storage, UFS). The processor 110 runs theinstruction stored in the internal memory 121 and/or the instructionstored in the memory disposed in the processor, to execute variousfunction applications of the electronic device 100 and data processing.

The external memory interface 120 may be configured to connect to anexternal storage card, for example, a micro SD card, to extend a storagecapability of the electronic device. The external memory cardcommunicates with the processor 110 through the external memoryinterface 120, to implement a data storage function. For example, a filesuch as a picture or a video is stored in the external storage card.

The electronic device 100 may implement an audio function, for example,music playing and recording, by using the audio module 170, the speaker170A, the receiver 170B, the microphone 170C, the headset jack 170D, theapplication processor, and the like.

The sensor module 180 may include a pressure sensor 180A, a gyroscopesensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D,an acceleration sensor 180E, a distance sensor 180F, an opticalproximity sensor 180G, a fingerprint sensor 180H, a temperature sensor180J, a touch sensor 180K, an ambient light sensor 180L, a boneconduction sensor 180M, and the like.

The button 190 includes a power button, a volume button, and the like.The button 190 may be a mechanical button, or may be a touch button. Theelectronic device 100 may receive a button input, and generate a buttonsignal input related to user setting and function control of theelectronic device 100. The motor 191 may generate a vibration prompt.The indicator 192 may be an indicator, and may be configured to indicatea charging status and a power change, or may be configured to indicate amessage, a missed call, a notification, and the like. The SIM cardinterface 195 is configured to connect to a SIM card. The SIM card maybe inserted into the SIM card interface 195 or removed from the SIM cardinterface 195, to implement contact with or separation from theelectronic device 100.

It can be understood that the components shown in FIG. 1 do notconstitute a specific limitation on the electronic device 100. Themobile phone may further include more or fewer components than thoseshown in the figure, or combine some components, or split somecomponents, or have different component arrangements. In addition, acombination/connection relationship between the components in FIG. 1 mayalso be adjusted and modified.

This application provides a first device and a second device. Forexample, the first device may be implemented as the electronic device100, or may be a chip or another functional component (in this case, thefirst device may also be referred to as a first apparatus) disposed inthe electronic device 100, or the first device may be implemented inanother form. For example, the second device may be implemented as theelectronic device 100, or may be a chip or another functional component(in this case, the second device may also be referred to as a secondapparatus) disposed in the electronic device 100, or the second devicemay be implemented in another form. One or more of the microphone 170C,the camera 193, the fingerprint sensor 180H, the touch sensor 180K, orthe bone conduction sensor 180M shown in FIG. 1 may collect an operationof a user in this application. Alternatively, embodiments of thisapplication may provide some peripheral input devices to collect anoperation of a user. For example, the electronic device 100 is connectedto some peripheral input devices, and these peripheral input devices cancollect the operation of the user. The peripheral input device includes,for example, a keyboard or a mouse.

This application further provides a multi-screen collaboration system.The multi-screen collaboration system may include the first device andthe second device. Certainly, the multi-screen collaboration system mayfurther include another device. For example, three or more devices mayalso perform multi-screen collaboration. In embodiments of thisapplication, a multi-screen collaboration process between two devices ismainly used as an example.

Currently, in a multi-screen collaboration (or referred to asmulti-device collaboration) scenario, regardless of which device a userperforms an operation on, a response is made on one of the devicesparticipating in multi-screen collaboration. For example, duringmulti-screen collaboration between a mobile phone and a PC, regardlessof whether a user performs an operation on the mobile phone or the PC toopen a file, the file is opened on the PC but not on the mobile phone.However, if the user actually wants to view the file on the mobilephone, this cannot be implemented in the current manner. The user cannormally open and view corresponding content on the mobile phone onlyafter exiting the multi-screen collaboration mode. However, this processrequires a plurality of steps, which is complex.

For example, a user performs an operation by using a mobile phone, and afile in the mobile phone needs to be opened on a personal computer(personal computer, PC) for a user using the PC to view. In this way,two users do not need to use the mobile phone at the same time. Adisplay of the PC is larger, which can also bring a better viewingeffect. In this case, the mobile phone and the PC may enter amulti-screen collaboration mode. The mobile phone may open a file in themulti-screen collaboration mode, and the file is displayed on the PC.FIG. 2 is a schematic diagram of a process of opening a file in themulti-screen collaboration mode.

In FIG. 2, 1 indicates that a user taps a file displayed on a display ofthe mobile phone, and a mobile phone assistant (or referred to as amobile phone PC assistant) installed on the mobile phone obtains tapoperation information of the user and responds to the tap operation.Alternatively, in FIG. 2, 1 indicates that the user clicks a filedisplayed on a projection interface of the mobile phone on a display ofthe PC, and a PC manager installed on the PC obtains click operationinformation of the user and responds to the click operation.

In FIG. 2, 2 indicates that the PC manager installed on the PC sends theobtained click operation information of the user to the mobile phoneassistant.

In FIG. 2, 3 indicates that the mobile phone stops opening of the file.If the mobile phone determines, based on a normal process, that the userperforms an operation of opening a file on the mobile phone, the mobilephone responds to the operation and opens the corresponding file.However, in the multi-screen collaboration mode, the file can be openedon only the PC but not on the mobile phone. Therefore, the mobile phoneneeds to stop the operation of opening the file that originally needs tobe performed.

In FIG. 2, 4 indicates that the mobile phone obtains a path of the file.The path of the file herein is an absolute path of the file, that is, astorage path of the file in the mobile phone.

In FIG. 2, 5 indicates that the mobile phone assistant creates a softlink in a distributed file system (ming distributed file system, MDFS)of the mobile phone. The soft link directs to a storage path, and thestorage path is the storage path of the file in the mobile phone, forexample, a storage path of the file in a secure digital memory card(secure digital memory card, SD) of the mobile phone or a uniformresource locator (uniform resource locator, URL) of the file. Inaddition, the soft link is further associated with metadata of the file,and the metadata of the file includes, for example, a storage path ofthe file, and certainly may further include other content of the file,for example, type information of the file.

In FIG. 2, 6 indicates that the distributed file system of the mobilephone synchronizes the metadata of the file to a distributed file systemof the PC.

In FIG. 2, 7 indicates that the mobile phone assistant obtains a path ofthe soft link created in the distributed file system.

In FIG. 2, 8 indicates that the mobile phone assistant sends the path ofthe soft link created in the distributed file system of the mobile phoneto the PC manager. In addition, the mobile phone assistant can alsoobtain the metadata of the file, for example, the type information ofthe file, and the mobile phone assistant may also send the obtainedmetadata of the file to the PC manager.

In FIGS. 2, 9 and 10 indicate that the PC manager invokes, based on thetype information of the file, an application that can open the file. Inaddition, the PC manager also sends the path of the soft link to theapplication. In FIG. 2 , an example in which the application is aMicrosoft Office application is used, and the application is representedas an “Office application” in FIG. 2 .

In FIG. 2, 11 indicates that the Office application opens the soft linkbased on the path of the soft link.

In FIG. 2, 12 indicates that the distributed file system of the PCrequests to obtain the file from the distributed file system of themobile phone based on the metadata (for example, based on the storagepath of the file included in the metadata) corresponding to the softlink.

In FIG. 2, 13 indicates that the distributed file system of the mobilephone reads a file that the soft link actually directs to. In addition,the distributed file system of the mobile phone sends the read file tothe distributed file system of the PC, so that the Office application onthe PC can open the file.

It can be learned from the foregoing process that currently, in amulti-screen collaboration (or referred to as multi-devicecollaboration) scenario, regardless of which device a user performs anoperation on, a response is made on one of the devices participating inmulti-screen collaboration. For example, during multi-screencollaboration between a mobile phone and a PC, regardless of whether auser performs an operation on the mobile phone or the PC to open a file,the file is opened on the PC but not on the mobile phone. However, ifthe user actually wants to view the file on the mobile phone, thiscannot be implemented in the current manner. The user can normally openand view corresponding content on the mobile phone only after exitingthe multi-screen collaboration mode. However, this process requires aplurality of steps, which is complex.

In view of this, in this application, the device may determine anoperation focus of the user based on an operation of the user, ordetermine a device on which the user expects to view, to select acorresponding device according to an intention of the user to respond.In this manner, a response result can meet a user requirement, and userexperience is improved. For example, when a mobile phone and a PCperform multi-screen collaboration, if a user performs an operation onthe mobile phone to open a file, the file may be opened on the mobilephone; or if the user performs an operation on the PC to open a file,the file may be opened on the PC. It can be learned that the user canopen and view corresponding content on the mobile phone without exitingthe multi-screen collaboration mode. This simplifies an operationprocess of the user. The device does not need to respond for a pluralityof times, and this helps reduce power consumption of the device.

The following describes the technical solutions provided in embodimentsof this application.

In embodiments of this application, the first device and the seconddevice need to perform multi-screen collaboration. For ease ofunderstanding, in the following description process, an example in whichthe first device is a mobile phone and the second device is a portablecomputer is used. A structure of the mobile phone is, for example, thestructure shown in FIG. 1 . In view of this, the electronic device 100shown in FIG. 1 may also be referred to as a mobile phone 100. Inaddition, the first device needs to implement a multi-screencollaboration function, for example, by using first manager softwareinstalled on the first device. The second device needs to implementmulti-screen collaboration, for example, by using second managersoftware installed on the second device. It can be learned from theforegoing descriptions that the first manager software may be a softwaremodule that runs independently on the first device, or may be a part ofsystem software of the first device. The second manager software may bea software module that runs independently on the second device, or maybe a part of system software of the second device. In addition,“projection software” may also have another name, for example, may alsobe referred to as a “projection application (APP)”. If the first deviceis the mobile phone 100, the first manager software may also be referredto as a mobile phone assistant or the like. It should be understood thatthe manager software may also be referred to as another name. The word“manager” does not have a specific meaning, and does not mean that themanager software definitely needs to manage other software on a devicein which the manager software is located.

In addition, in embodiments of this application, a software module andan application (APP) may be a same concept. For example, a mobile phoneassistant is a software module, and is also an application. Therefore,“software” may be replaced with “application (APP)”. For example,“manager software” may also be referred to as a “manager application”,and “projection software” may also be referred to as a “projectionapplication”. Alternatively, the application may include one or moresoftware modules, but the software module cannot be considered as anapplication. For example, a manager software is a software module, butis not an independent application. It may be considered that the managersoftware is a software module set in a corresponding application (forexample, a manager application), or may be a software module set insystem software. Similarly, a projection software is a software module,but is not an independent application. It may be considered that theprojection software is a software module set in a correspondingapplication (for example, a projection application), or may be asoftware module set in system software. An “application” is an icon thatcan be directly invoked by a user. For example, icons such as “Messages”and “Application market” displayed on a display interface of the mobilephone represent corresponding applications. In the following descriptionprocess, an example in which a software module and an application are asame concept is used.

FIG. 3A shows a GUI of the mobile phone 100. The GUI is a home screen201 of the mobile phone. If a user expects that the mobile phone 100 andthe portable computer perform multi-screen collaboration, the user needsto enable both the mobile phone 100 and the portable computer to enter amulti-screen collaboration mode. A preset manner may be used to enablethe mobile phone 100 and the portable computer to enter the multi-screencollaboration mode, and the preset manner may include a plurality ofoperation manners. For example, as shown in FIG. 3B, the user may holdthe mobile phone 100 to tap the portable computer, for example, tap anNFC area of the portable computer. In this case, the mobile phone 100and the portable computer may establish an NFC connection, and bothenter the multi-screen collaboration mode. In this case, the presetmanner is the “OneHop” manner. That is, the user needs to perform onlyone operation (a tap operation), so that a connection can be establishedbetween the two devices, and the two devices can enter the multi-screencollaboration mode. FIG. 3B mainly shows a process in which the mobilephone 100 taps the portable computer. Therefore, a display interface ofthe mobile phone 100 is not drawn in detail.

Alternatively, the user may enable a Bluetooth function on the mobilephone 100 and the portable computer. For example, after the Bluetoothfunction is enabled, the mobile phone 100 scans surrounding Bluetoothdevices. If the mobile phone 100 finds the portable computer throughscanning, the mobile phone 100 and the portable computer may establish aBluetooth connection, and both enter the multi-screen collaborationmode. In this case, the preset manner is a manner in which the userenables the Bluetooth function, or a manner in which the mobile phone100 scans the portable computer. That is, the user needs to perform onlyone operation (an operation of enabling the Bluetooth function), so thata connection can be established between the two devices, and the twodevices can enter the multi-screen collaboration mode. Alternatively,the user enables the Bluetooth function on the mobile phone 100 and theportable computer. For example, after the Bluetooth function is enabled,the mobile phone 100 scans surrounding Bluetooth devices. If the mobilephone 100 finds the portable computer through scanning, the mobile phone100 and the portable computer may establish a Bluetooth connection.After the mobile phone 100 and the portable computer establish theBluetooth connection, the user performs a corresponding operation, sothat the mobile phone 100 and the portable computer enter themulti-screen collaboration mode. For example, second projection softwareis installed on the portable computer, and first projection software isinstalled on the mobile phone 100. The operation performed by the useris, for example, an operation of scanning, by using the first projectionsoftware, a two-dimensional code provided by the second projectionsoftware, and the operation performed by the user is considered as apreset manner. That is, the user needs to perform at least twooperations, so that the two devices establish a connection and enter themulti-screen collaboration mode.

Alternatively, the mobile phone 100 and the portable computer mayestablish a connection through Wi-Fi or in another manner, and enter themulti-screen collaboration mode.

Alternatively, the second projection software is installed on theportable computer, and the first projection software is installed on themobile phone 100. The first projection software and the secondprojection software may be of two different types, or may be of a sametype, but are installed on different devices. It can be learned from theforegoing description that the first projection software may be asoftware module that runs independently on the mobile phone 100, or maybe a part of system software of the mobile phone 100. The secondprojection software may be a software module that runs independently onthe portable computer, or may be a part of system software of theportable computer. It should be understood that the “projectionsoftware” may also have another name, for example, may be referred to asa “projection application”. In addition, the projection software and themanager software may be a same software module. For example, the firstprojection software and the first manager software may be a samesoftware module, and the second projection software and the secondmanager software may be a same software module. Alternatively, theprojection software and the manager software may be different softwaremodules. For example, the first projection software and the firstmanager software may be different software modules, and the secondprojection software and the second manager software may be differentsoftware modules. For example, the first projection software is a partof the system software of the mobile phone 100, and the first managersoftware is a software module that runs independently on the mobilephone 100 and does not belong to the system software. In this case, itis considered that the first projection software and the first managersoftware are different software modules. For another example, both thefirst projection software and the first manager software are softwaremodules that run independently on the mobile phone 100, but aredifferent software modules. In this case, it is also considered that thefirst projection software and the first manager software are differentsoftware modules. The user may open the second projection software onthe portable computer and also open the first projection software on themobile phone 100. The second projection software on the portablecomputer may provide a two-dimensional code. The user may use the mobilephone 100 to scan, by using the first projection software on the mobilephone 100, the two-dimensional code provided by the second projectionsoftware on the portable computer, so that the mobile phone 100 and theportable computer can establish a connection and both enter themulti-screen collaboration mode. Alternatively, an operation ofscanning, by the user by using the first projection software on themobile phone 100, the two-dimensional code provided by the secondprojection software on the portable computer only enables the twodevices to enter the multi-screen collaboration mode, and the twodevices have established a connection before, for example, a Bluetoothconnection or a Wi-Fi connection.

Alternatively, the user may log in to a same account on the secondprojection software of the portable computer and the first projectionsoftware of the mobile phone 100, for example, enter a same account andpassword on the second projection software of the portable computer andthe first projection software of the mobile phone 100. In this way, themobile phone 100 and the portable computer can establish a connectionand enter the multi-screen collaboration mode without scanning thetwo-dimensional code. The preset manner is an operation manner ofentering a same account and password by the user on the secondprojection software of the portable computer and the first projectionsoftware of the mobile phone 100. Alternatively, an operation ofentering a same account and password by the user on the secondprojection software of the portable computer and the first projectionsoftware of the mobile phone 100 only enables the two devices to enterthe multi-screen collaboration mode, and the two devices haveestablished a connection before, for example, a Bluetooth connection ora Wi-Fi connection.

If the first projection software is installed on the mobile phone 100,the first manager software can capture an operation performed by theuser on the first projection software, and the first manager softwarecan send, to the first projection software, an instruction from theportable computer (or from the second manager software). Similarly, ifthe second projection software is installed on the portable computer,the second manager software can capture an operation performed by theuser on the second projection software, and the second manager softwarecan send, to the second projection software, an instruction from themobile phone 100 (or from the first manager software).

Alternatively, the user may use another manner to enable both the mobilephone 100 and the portable computer to enter the multi-screencollaboration mode. A specific manner is not limited.

In addition, as shown in FIG. 3C, in the multi-screen collaborationmode, a display of the portable computer displays a current displayinterface 202 of the mobile phone 100. The display interface 202 mayalso be referred to as a projection interface 202 or a screen recordinginterface 202. The projection interface 202 is a mirror of a displayinterface of the mobile phone 100. The projection interface 202displayed on the portable computer and the display interface of themobile phone 100 are from a same source, that is, both from the mobilephone 100. For example, the mobile phone 100 sends information about thedisplay interface of the mobile phone to the portable computer, so thatthe portable computer can display the projection interface 202 at ascale that is the same as a size of a display of the mobile phone 100.After the portable computer displays the projection interface 202, theuser may also perform an operation such as scaling up or scaling down onthe projection interface 202, to change a size of the projectioninterface 202, or the user may further perform an operation such asdragging on the projection interface 202, to change a position of theprojection interface 202 on the display of the portable computer.

After both the mobile phone 100 and the portable computer enter themulti-screen collaboration mode, according to the technical solutionprovided in this application, the user may choose to view content on themobile phone on the portable computer side. The display of the portablecomputer is larger, and viewing on a large screen can bring betterviewing experience to the user. Alternatively, the user may choose toview the content on the mobile phone on the mobile phone side. Themobile phone is more portable, and can meet a requirement of viewing atany time. The following describes how to select a device for viewing.

For example, the user performs a first operation on the projectioninterface 202 displayed on the portable computer. The first operationis, for example, a touch operation. As shown in FIG. 4A, the firstoperation is an operation of touching a file icon “file 3” on theprojection interface 202 by the user by using a finger. This indicatesthat the user wants to open a file 3. A touch sensor on the display ofthe portable computer may collect (or capture) event information of thefirst operation. In other words, the touch sensor on the display of theportable computer may capture the first operation of the user, andobtain the event information corresponding to the first operation, wherethe event information may indicate the first operation. Because an areafor which the first operation is performed is the projection interface202, the touch sensor may send the collected event information of thefirst operation to the second manager software. The event information ofthe first operation includes, for example, an identifier of the portablecomputer, and optionally, may further include position information ofthe first operation. The position information of the first operation is,for example, relative position information of the first operation on theprojection interface 202. In this way, even if the projection interface202 is in a different position on the display of the portable computer,the relative position information of the first operation remainsunchanged. For the mobile phone 100, the file corresponding to the firstoperation may be determined based on an area conversion ratio betweenthe display 194 of the mobile phone 100 and the projection interface 202and the relative position information of the first operation.

Alternatively, the first operation may also be another operation such asa voice control operation, a gesture operation, or a pressing operationperformed on the display of the portable computer. In this case, thefirst operation is collected by using a different sensor in the portablecomputer. A type of the first operation is not limited in embodiments ofthis application.

The second manager software sends the event information of the firstoperation to the first manager software. A sending manner depends on aconnection manner between the mobile phone 100 and the portablecomputer, for example, NFC, Bluetooth, Wi-Fi, or a mobile network. Afterthe first manager software receives the event information of the firstoperation, because the event information of the first operation includesthe identifier of the portable computer, the first manager softwaredetermines that the event information of the first operation correspondsto the portable computer, that is, determines that the first operationis an operation performed on the portable computer. In other words, thefirst manager software determines that a file icon (for example, thefile icon “file 3”) corresponding to the first operation is located onthe display interface of the portable computer. In this case, the firstmanager software may determine a storage path of the file correspondingto the first operation. For example, if the event information of thefirst operation includes the relative position information of the firstoperation on the projection interface 202, the first manager softwaremay determine the file such as the file 3 corresponding to the firstoperation based on the area conversion ratio between the projectioninterface 202 and the display 194 of the mobile phone 100 and therelative position information of the first operation, so that the firstmanager software can determine a storage path of the file 3. The firstmanager software may create a soft link corresponding to the file in adistributed file system of the mobile phone 100. The soft link directsto the storage path of the file. For example, the soft link directs to astorage path of the file in an SD card of the mobile phone or a URL ofthe file. In addition, the soft link is associated with metadata of thefile. The distributed file system of the mobile phone 100 maysynchronize the metadata of the file corresponding to the firstoperation to a distributed file system of the portable computer.

Metadata of a file may also be referred to as description information ofthe file. The metadata of the file includes, for example, a storage pathof the file. Optionally, the metadata may further include one or more ofthe following: a name of the file, type information of the file, or sizeinformation of the file. For example, metadata of a file may includestorage path information of the file; or metadata of a file may includetype information of the file and storage path information of the file;or metadata of a file may include size information of the file, a nameof the file, and storage path information of the file. A storage pathindicated by storage path information of a file may be a storage path ofthe file in the mobile phone 100. In the foregoing example, the filecorresponding to the first operation is the file 3, and the distributedfile system of the mobile phone 100 may synchronize metadata of the file3 to the distributed file system of the portable computer.

The first manager software may obtain a path of the soft link created inthe distributed file system of the mobile phone 100, and the firstmanager software may send the path of the soft link to the secondmanager software. In addition, the first manager software can alsoobtain the metadata of the file, for example, the type information ofthe file, and the first manager software may also send the obtainedmetadata of the file to the second manager software.

The second manager software determines and invokes, based on the typeinformation of the file and the like, an application that can open thefile. For example, the second manager software determines that a secondapplication can open the file. In embodiments of this application, ifthe two nouns “software” and “application” can be exchanged, the “secondapplication” may also be referred to as “second software”; or if“software” and “application” are not concepts at a same level and cannotbe exchanged, it may be considered that one or more software modules areset in the second application. For example, if type information of thefile 3 indicates that the file 3 is of an image type, the second managersoftware may determine that an image application can open the file 3.For another example, if the type information of the file 3 indicatesthat the file 3 is a Microsoft Word document, the second managersoftware may determine that a Microsoft Office Word application can openthe file 3. In addition, the second manager software also sends the pathof the soft link to the second application.

The second application opens the soft link based on the path of the softlink. In this case, the distributed file system of the portable computermay obtain the file 3 from the mobile phone 100 based on the metadatacorresponding to the soft link. This may be understood as obtaining dataof the file 3 from the mobile phone 100. For example, the distributedfile system of the portable computer may obtain the file 3 from themobile phone 100 based on storage path information of the file 3included in the metadata corresponding to the soft link. Therefore, thesecond application can open the file 3.

FIG. 4B is a schematic diagram of opening the file 3 on the portablecomputer. An interface 203 in FIG. 4B represents an interface of thefile 3 opened on the portable computer. In FIG. 4B, an example in whichthe file 3 is a word file is used. After the file is opened on theportable computer, the user may adjust a size of the interface 203. Asshown in FIG. 4B, the interface 203 and the projection interface 202 maybe displayed together. Alternatively, the interface 203 may cover theprojection interface 202, as shown in FIG. 4C. Alternatively, the usermay set the projection interface 202 to “pin to top”, and a part or allof an area of the projection interface 202 may also be located on theinterface 203, as shown in FIG. 4D.

In this manner, if the file 3 is opened on the portable computer, thefile 3 is not opened on the mobile phone 100.

In addition, the portable computer may further store the data of thefile 3 in the portable computer. For example, the portable computer maystore the data of the file 3 in a local file system of the portablecomputer by using the second application, for example, may store thedata of the file 3 as a temporary file.

The user may view the file 3 on the portable computer by using thesecond application, or the user may perform an editing operation on thefile 3 on the portable computer by using the second application, forexample, may delete content, add content, or modify content in the file3. After the user completes an operation on the file 3, the file 3 maybe saved, and the portable computer may update the stored data of thefile 3, to obtain updated data of the file 3. The updated data of thefile 3 may be understood as an updated file 3. This is equivalent to aprocess in which the portable computer uses the updated data of the file3 to overwrite the original data of the file 3 stored in the portablecomputer. The portable computer may send the updated data of the file 3to the mobile phone 100. For example, the portable computer maysynchronize a second file to the distributed file system of the mobilephone 100 by using the distributed file system of the portable computer.In this case, the mobile phone 100 may use the updated data of the file3 to overwrite the original data of the file 3 stored in a local filesystem of the mobile phone 100. In this way, the file 3 is updated. Theportable computer may send the updated data of the file 3 to the mobilephone 100 each time after the user updates the file 3, so that the file3 can be updated in time on the mobile phone side. Alternatively, theportable computer may send the updated data of the file 3 to the mobilephone 100 after the user closes the file 3, to reduce a quantity oftimes of sending the updated data, and reduce transmission overheads. Inaddition, after the portable computer sends the updated data of the file3 to the mobile phone 100, the portable computer may delete the storedupdated data of the file 3. For example, the portable computer maydelete the temporary file to release storage space.

The foregoing describes a process in which the user performs anoperation on the portable computer in the multi-screen collaborationmode. Alternatively, in the multi-screen collaboration mode, the usermay still perform an operation on the mobile phone 100. For example, theuser may be in a moving state, and it is more convenient to use themobile phone 100 in a moving process; or the user is far away from theportable computer, and it is more convenient for the user to use themobile phone 100 nearby. The following describes how the devices respondwhen the user performs an operation on the mobile phone.

For example, the user performs a second operation (or may also bereferred to as a first operation) on the mobile phone 100. The secondoperation is, for example, a touch operation. As shown in FIG. 5A, thesecond operation is an operation of touching a file icon “file 3” on thedisplay interface of the mobile phone by the user by using a finger.This indicates that the user wants to open the file 3. The touch sensor180K on the display 194 of the mobile phone 100 may collect (or detect)event information of the second operation. In other words, the touchsensor 180K on the display 194 of the mobile phone 100 may capture thesecond operation, and obtain the event information of the secondoperation, where the event information of the second operation mayindicate the second operation. The touch sensor 180K may send thecollected event information of the second operation to the first managersoftware. The event information of the second operation includes, forexample, an identifier of the mobile phone 100, and optionally, mayfurther include position information and the like of the secondoperation. The position information of the second operation is, forexample, absolute position information of the second operation on thedisplay 194.

After the first manager software obtains the event information of thesecond operation, because the event information of the second operationincludes the identifier of the mobile phone 100, for example, from thetouch sensor 180K, the first manager software may determine that theevent information of the second operation corresponds to the mobilephone 100, that is, determines that the second operation is an operationperformed on the mobile phone 100. In other words, the first managersoftware determines that a file icon (for example, the file icon “file3”) corresponding to the second operation is located on the displayinterface of the mobile phone 100. In this case, the first managersoftware may determine the file such as the file 3 corresponding to thesecond operation based on the position information of the secondoperation, and then the first manager software may determine, based onthe type of the file 3, an application that can open the file 3, forexample, the first application. In embodiments of this application, ifthe two nouns “software” and “application” can be exchanged, the “firstapplication” may also be referred to as “first software”; or if“software” and “application” are not concepts at a same level and cannotbe exchanged, it may be considered that one or more software modules areset in the first application. The second application described above andthe first application herein may be a same application, for example,both are a Microsoft Office Word application, but have different namesbecause the applications are installed on different devices.Alternatively, the first application and the second application may bedifferent applications. For example, the first application is aMicrosoft Office Word application, and the second application is a WPSOffice Word application, but both the first application and the secondapplication can open files of a same type.

Then, the first manager software may open, on the mobile phone 100 byusing the first application, the file 3 stored in the local file systemof the mobile phone 100. FIG. 5B is a schematic diagram of opening thefile 3 on the mobile phone 100. An interface 204 in FIG. 5B indicates aninterface of the file 3 opened on the display 194 of the mobile phone100. After a file is opened on the mobile phone 100, the user may adjusta size of the interface 204.

In this manner, if the file 3 is opened on the mobile phone 100, thefile 3 is not opened on the portable computer.

The user may view the file 3 on the mobile phone 100 by using the firstapplication, or the user may perform an editing operation on the file 3on the mobile phone 100 by using the first application, for example, maydelete content, add content, or modify content in the file 3. After theuser completes an operation on the file 3, the file 3 may be saved, andthe mobile phone 100 may update data of the file 3 stored in the localfile system of the mobile phone 100.

FIG. 6 is a schematic diagram of a process of opening a file in themulti-screen collaboration mode after the method provided in theforegoing embodiment of this application is used.

In FIG. 6, 1 indicates that a user taps a file displayed on the displayinterface of the mobile phone 100, and the first manager software (forexample, a mobile phone assistant in FIG. 6 ) installed on the mobilephone 100 obtains tap operation information of the user, and responds tothe tap. Alternatively, in FIG. 6, 1 indicates that the user clicks afile displayed on the projection interface 202 of the mobile phone onthe display of the portable computer, and the second manager software(for example, a PC manager in FIG. 6 ) installed on the portablecomputer obtains click operation information of the user, and respondsto the click.

In FIG. 6, 2 indicates that the second manager software sends theobtained click operation information of the user to the first managersoftware.

In FIG. 6, 3 indicates that the first manager software performs focusdetermining, that is, determines a position of an operation focus of theuser. In embodiments of this application, for example, the first managersoftware may determine the focus of the user based on a parameter of atap response. For example, if the tap operation information is sent bythe second manager software, the first manager software may set a valueof the parameter of the tap response to a first value when responding tothe tap. If the tap operation information is sent by a sensor (forexample, the touch sensor 180K) in the mobile phone 100, the firstmanager software may set a value of the parameter of the tap response toa second value when responding to the tap. In this way, when determiningthe focus, the first manager software can determine, based on differentvalues of the parameter of the tap operation, a device on which theoperation of the user is performed, or a device on which the operationfocus of the user is located.

In FIG. 6, 4 indicates that the first manager software performsdifferent processing based on a focus determining result.

If the first manager software determines that the operation focus of theuser is located on the portable computer, the first manager software maystop opening of the file. This is because the operation focus of theuser is located on the portable computer, and therefore the file needsto be opened on the portable computer, and the file is not opened on themobile phone 100. Therefore, the mobile phone 100 needs to stop anoperation that is used to open the file and that originally needs to beperformed.

In FIG. 6, 5 indicates that the first manager software obtains a path ofthe file. The path of the file herein is an absolute path of the file,that is, a storage path of the file in the mobile phone 100.

In FIG. 6, 6 indicates that the first manager software creates a softlink in the distributed file system in the mobile phone. The soft linkdirects to a first storage path, and the first storage path is a storagepath of the file in the mobile phone, for example, a storage path of thefile in an SD of the mobile phone or a URL of the file. In addition, thesoft link is further associated with metadata of the file, and themetadata of the file includes, for example, a storage path of the file,and optionally, may further include type information of the file.

In FIG. 6, 7 indicates that the distributed file system of the mobilephone 100 synchronizes the metadata of the file to the distributed filesystem of the portable computer.

In FIG. 6, 8 indicates that the first manager software obtains a path ofthe soft link created in the distributed file system of the mobile phone100.

In FIG. 6, 9 indicates that the first manager software sends, to thesecond manager software, the path of the soft link created in thedistributed file system of the mobile phone 100. In addition, the firstmanager software can also obtain the metadata of the file, for example,the type information of the file, and the first manager software mayalso send the obtained metadata of the file to the second managersoftware.

In FIGS. 6, 10 and 11 indicate that the second manager software invokes,based on the type information of the file, an application that can openthe file. In addition, the second manager software also sends the pathof the soft link to the application. In FIG. 6 , an example in which theapplication is a Microsoft Office application is used.

In FIG. 6, 12 indicates that the Office application opens the soft linkbased on the path of the soft link.

In FIG. 6, 13 indicates that the distributed file system of the portablecomputer requests to obtain the file from the distributed file system ofthe mobile phone 100 based on the metadata (for example, based on thestorage path of the file included in the metadata) corresponding to thesoft link.

In FIG. 6, 14 indicates that the distributed file system of the mobilephone 100 reads a file that the soft link actually directs to. Forexample, the distributed file system of the mobile phone 100 reads thefile from the local file system of the mobile phone 100. In addition,the distributed file system of the mobile phone 100 further sends theread file to the distributed file system of the portable computer, sothat the Office application on the portable computer can open the file.In addition, the portable computer may further store the data of thefile 3 in the portable computer. For example, the portable computer maystore the data of the file 3 in the local file system of the portablecomputer by using the second application, for example, may store thedata as a temporary file. The user may perform an operation such ascontent modifying, deleting, or adding on the file 3 by using the secondapplication on the portable computer, and the temporary file stored inthe local file system of the portable computer may be updated. After theupdate, the portable computer may send an updated file to the mobilephone 100, so that the mobile phone 100 can update, based on the updatedfile, the original file stored in the local file system of the mobilephone 100.

5 to 14 in FIG. 6 describe how to open a file on the portable computer.Alternatively, if the first manager software determines that theoperation focus of the user is on the mobile phone 100, the mobile phone100 may invoke an application that can open the file, for example, thefirst application. Then, with reference to 15 in FIG. 6 , the firstapplication opens the file based on the storage path of the file in thelocal file system of the mobile phone 100.

For a same file in the first device, after the method provided inembodiments of this application is used, final experience effects of anoperation on the first device and an operation in a collaboration window(for example, the projection interface 202) mirrored by the first deviceto the second device are different. Even in a multi-screen collaborationscenario, the first device may intelligently select a device based on acurrent focus of the user (for example, a device on which the operationof the user is performed), to open, edit, and save a corresponding file,the user can complete office work without leaving or switching thecurrent focused screen, to provide better preview and editing experiencefor the user.

In the manner described above, if the user performs an operation on themobile phone 100, the mobile phone 100 opens a corresponding file. Thefollowing describes another manner. In this manner, if the user performsan operation on the mobile phone 100, the mobile phone 100 may providean option for the user, and the user chooses to open a correspondingfile on the mobile phone 100 or the portable computer. In this manner, adevice on which the file is finally opened better meets a requirement ofthe user.

For example, the user performs a second operation on the mobile phone100. The second operation is, for example, a touch operation, and thesecond operation is used to open a first file. Still refer to FIG. 5A.The second operation is an operation of touching a file icon “file 3” onthe display interface of the mobile phone by the user by using a finger,which indicates that the user wants to open the file 3. The touch sensor180K on the display 194 of the mobile phone 100 may capture the secondoperation, and obtain event information of the second operation. Thetouch sensor 180K may send the event information of the second operationto the first manager software. The event information of the secondoperation includes, for example, an identifier of the mobile phone 100,and optionally, may further include position information and the like ofthe second operation. The position information of the second operationis, for example, absolute position information of the second operationon the display 194. It should be understood that the touch operation inthis specification may be replaced with a floating operation, a voiceinstruction, and the like. In this specification, the touch operation isused as an example for description, but this does not constitute alimitation on embodiments of this application.

After the first manager software obtains the event information of thesecond operation, because the event information of the second operationincludes the identifier of the mobile phone 100, the first managersoftware may determine that the event information of the secondoperation corresponds to the mobile phone 100, that is, determines thatthe second operation is an operation performed on the mobile phone 100.In other words, the first manager software determines that a file icon(for example, the file icon “file 3”) corresponding to the secondoperation is located on the display interface of the mobile phone 100.In this case, the first manager software may output prompt information205 by using the display 194, and the prompt information 205 may includeone or more options, and the prompt information 205 may be used todetermine a device on which the file 3 is to be opened. For example,FIG. 7A is a schematic diagram of the prompt information 205 displayedon the display 194 of the mobile phone 100. For example, the promptinformation 205 includes four options. One option is “Computerapplication”, which indicates that the file 3 is to be opened on acollaboration device (for example, the portable computer). The remainingthree options are “1”, “2”, and “3”, which respectively represent anapplication 1, an application 2, and an application 3. All the threeapplications are applications on the mobile phone 100, and are alsoapplications that can open the file 3. One or more applications on themobile phone 100 can open the first file. If only one application on themobile phone 100 can open the first file, the prompt information 205displays only one option in addition to the option “Computerapplication”. Alternatively, if a plurality of applications on themobile phone 100 can open the first file, the prompt information 205 maydisplay options corresponding to all applications or some applicationsthat can open the first file in addition to the option “Computerapplication”. If the user selects the option “Computer application”, itindicates that the user chooses to open the first file on thecollaboration device. If the user selects any application other than the“computer application”, it indicates that the user chooses to open thefirst file on the mobile phone 100 by using the application.

As shown in FIG. 7B, for example, the user touches, by using a finger,the option “Computer application” included in the prompt information205, and it indicates that the user selects the “computer application”.In this case, the distributed file system of the mobile phone 100 maysynchronize metadata of the first file corresponding to the firstoperation to the distributed file system of the portable computer. Forthe metadata of the file, refer to the foregoing description. For anoperation process after the portable computer obtains the metadata ofthe first file, refer to the foregoing descriptions of the process ofopening the file 3 on the portable computer.

Optionally, in FIG. 7A or FIG. 7B, the prompt information 205 output bythe mobile phone 100 may not include a specific option on the portablecomputer. That is, the user cannot select a specific application on theportable computer based on the prompt information 205 output by themobile phone 100. For example, in FIG. 7A or FIG. 7B, if the userchooses to open the application on the portable computer, the user mayselect the option “Computer application”, and the option corresponds toonly the portable computer, and does not correspond to a specificapplication on the portable computer. If the user chooses to open thefirst file on the portable computer, the portable computer selects,based on a type of the first file, a corresponding application to openthe first file. Alternatively, in another manner, the prompt information205 output by the mobile phone 100 may include an option on the portablecomputer. For example, FIG. 7C is a schematic diagram of another promptinformation 205 displayed on the display 194 of the mobile phone 100.For example, the prompt information 205 includes five options. The fiveoptions are “1”, “2”, “3”, “4”, and “5”, which respectively represent anapplication 1, an application 2, an application 3, an application 4, andan application 5. The application 4 and the application 5 areapplications on the portable computer, and are also applications thatcan open the file 3, and this indicates that the file 3 is opened on thecollaboration device (for example, the portable computer). Theapplication 1, the application 2, and the application 3 are applicationson the mobile phone 100, and are also applications that can open thefile 3. In FIG. 7B, display fonts of “4” and “5” are larger and thicker,indicating that the application 4 and the application 5 are applicationson the portable computer, or another prompt manner may be used toindicate that a corresponding application is an application on theportable computer, for example, a prompt text may be displayed. In thismanner, the user may select an application that is used to open thefirst file on the portable computer, so that viewing experience of theuser is better.

Alternatively, as shown in FIG. 7D, for example, the user touches theoption “i” by using a finger, and it indicates that the user chooses toopen the first file on the mobile phone 100 by using the application 1corresponding to “i”, and the first manager software may invoke theapplication 1 corresponding to “i” to open the file 3. For an operationprocess after the first manager software invokes the application 1corresponding to “i” to open the file 3, refer to the foregoingdescriptions of the process of opening the file 3 on the mobile phone100.

For example, sometimes although the user performs an operation on themobile phone 100, the user actually expects to present a correspondingfile on the portable computer to another user for viewing. In thisscenario, according to the technical solution provided in embodiments ofthis application, the user may choose to open the file on the portablecomputer, so as to complete a presentation process. It can be learnedthat according to the technical solution provided in embodiments of thisapplication, a selection opportunity is provided for the user, and it ismore convenient for the user to select a proper device to open acorresponding file.

In the multi-screen collaboration mode, the collaboration windowdisplayed on the second device is a mirror of the display interface ofthe first device. Therefore, according to an existing manner, regardlessof whether the user performs an operation on the first device or thecollaboration window of the second device, an operation process is of asame source, and finally, the second device actually responds to theoperation of the user. However, embodiments of this application breakssuch a “same source” barrier by using a technology. A determiningmechanism is added to the first device. For a same file, if the userperforms an operation on different devices, the file may be opened onthe different devices. Therefore, differentiated experience differentfrom the conventional technology is generated, and better userexperience can be provided for the user. In addition, the user does notneed to open a corresponding file on the first device after exiting themulti-screen collaboration mode, which simplifies operation steps of theuser, reduces a response process of the device, and helps reduce powerconsumption of the device.

With reference to the foregoing embodiments and related accompanyingdrawings, an embodiment of this application provides a first fileopening method. The method may be used in a multi-screen collaborationscenario. For example, the method relates to a first device and a seconddevice. For a structure of the first device, refer to FIG. 1 . Refer toFIG. 8A and FIG. 8B. The following describes a procedure of the method.For ease of understanding, in the following description process, anexample in which the first device is the mobile phone 100 and the seconddevice is the portable computer is used.

The mobile phone 100 and the portable computer enter a multi-screencollaboration mode in a preset manner. For example, if the mobile phone100 and the portable computer enter the multi-screen collaboration modeas long as a connection is established, S801 may also be replaced with:The mobile phone 100 and the portable computer establish a connection.Alternatively, the mobile phone 100 and the portable computer need tofirst establish a connection, and then a user performs a correspondingoperation, so that the mobile phone 100 and the portable computer enterthe multi-screen collaboration mode. In this case, before S801, themobile phone 100 and the portable computer need to first establish aconnection.

There may be a plurality of operation manners for the mobile phone 100and the portable computer to enter the multi-screen collaboration mode.For example, the user may hold the mobile phone 100 to tap the portablecomputer, and the mobile phone 100 and the portable computer mayestablish an NFC connection, and enter the multi-screen collaborationmode. In this case, the preset manner is the “OneHop” manner.Alternatively, the preset manner may be another manner. For specificcontent, refer to the foregoing descriptions.

After the mobile phone 100 and the portable computer enter themulti-screen collaboration mode, a first interface is displayed on adisplay of the portable computer, and the first interface is a mirror ofa display interface of the mobile phone 100. It may be understood thatthe mobile phone 100 displays the first interface, the portable computerdisplays a second interface, and the mobile phone 100 may project thefirst interface onto the display of the portable computer, or in otherwords, project the first interface onto the second interface. After theprojection, the second interface includes the first interface. The firstinterface may include at least one file icon. Each file icon correspondsto one file, the at least one file icon corresponds to at least onefile, and the at least one file is stored in the mobile phone 100. Forexample, the first interface is the projection interface 202 shown inFIG. 3C, “file 1”, “file 2”, and “file 3” represent three file icons,and the three file icons correspond to three files: a file 1, a file 2,and a file 3.

For more content of S801, refer to the foregoing descriptions.

S802: The user performs an operation on the portable computer, and theportable computer collects the operation of the user and obtains eventinformation corresponding to the operation. For example, the operationis referred to as a first operation, and the portable computer maycapture the first operation and obtain the event information of thefirst operation. The first operation may be performed on a file icon.For example, the file icon is referred to as a first file icon, and thefirst file icon may belong to the at least one file icon. That is, theuser performs the first operation on the first file icon on the firstinterface included in the second interface displayed on the portablecomputer. The first file icon corresponds to one file, for example, thefile is referred to as a first file. For descriptions of the eventinformation of the first operation, refer to the foregoing relatedcontent.

For example, the first operation is a touch operation. For an example,refer to FIG. 4A. Alternatively, the first operation may be another typeof operation, for example, a gesture operation, a sound controloperation, or a floating operation. A purpose of performing the firstoperation by the user is to open the first file. Therefore, the firstoperation is an operation of opening the first file.

For more content of S802, refer to the foregoing descriptions.

S803: The portable computer sends the event information of the firstoperation to the mobile phone 100, and the mobile phone 100 receives theevent information of the first operation from the portable computer. Themobile phone 100 receiving the event information of the first operationmay also be equivalent to the mobile phone 100 detecting the operationperformed on the first file icon.

For example, a sensor (for example, a touch sensor or another sensor) inthe portable computer collects the event information of the firstoperation, and sends the event information of the first operation to asecond manager software installed on the portable computer. The secondmanager software may send the event information of the first operationto a first manager software installed on the mobile phone 100, and thefirst manager software receives the event information of the firstoperation from the second manager software. The first manager softwarereceiving the event information of the first operation may also beequivalent to the first manager software detecting the operationperformed on the first file icon.

For more content of S803, refer to the foregoing descriptions.

S804: The mobile phone 100 determines that the event information of thefirst operation corresponds to the portable computer. In other words,the mobile phone 100 determines that the first operation is performed onthe portable computer. In other words, the mobile phone 100 determinesthat the first operation (or the event information of the firstoperation) is performed on the display of the portable computer. Inother words, the mobile phone 100 determines that the file iconcorresponding to the first operation is located on a display interfaceof the portable computer. That the first operation corresponds to theportable computer means that the first operation is an operationperformed on the portable computer.

For example, after the first manager software receives the eventinformation of the first operation, because the event information of thefirst operation includes an identifier of the second device, the firstmanager software determines that the event information of the firstoperation corresponds to the portable computer, that is, determines thatthe first operation is an operation performed on the portable computer.In other words, the first manager software determines that the file iconcorresponding to the first operation is located on the display interfaceof the portable computer. For example, the event information of thefirst operation indicates that the first operation is a touch operation,and the first manager software may determine that the first operation isan operation performed on the display of the portable computer, ordetermine that the file icon corresponding to the first operation islocated on the display interface of the portable computer.

For more content of S804, refer to the foregoing descriptions.

S805: The mobile phone 100 determines that the file corresponding to theevent information of the first operation is the first file, or themobile phone 100 determines a storage path of the first filecorresponding to the event information of the first operation, or themobile phone 100 determines that the first operation corresponds to thefirst file.

For example, if the event information of the first operation includesrelative position information of the first operation on the firstinterface, the first manager software may determine a file such as thefirst file corresponding to the first operation based on an areaconversion ratio between the first interface and the display 194 of themobile phone 100 and the relative position information of the firstoperation. The first file is, for example, the file 3 described above.In addition, the first manager software may determine a storage path ofthe first file, and the first manager software creates a soft linkcorresponding to the first file in a distributed file system of themobile phone 100. The soft link directs to the storage path of the firstfile. For example, the soft link directs to a storage path of the firstfile in an SD card of the mobile phone or a URL of the file. Inaddition, the soft link is associated with metadata of the first file.

For more content of S805, refer to the foregoing descriptions.

S806: The mobile phone 100 sends the metadata of the first file to theportable computer, and the portable computer receives the metadata ofthe first file from the mobile phone 100.

For example, the metadata of the first file includes one or more of thefollowing: a name of the first file, type information of the first file,size information of the first file, or storage path information of thefirst file. For more descriptions of the metadata of the first file,refer to the foregoing descriptions.

For example, the distributed file system of the mobile phone 100 maysynchronize (or send) the metadata of the file corresponding to thefirst operation to a distributed file system of the portable computer.

For more content of S806, refer to the foregoing descriptions.

S807: The portable computer determines, based on the metadata of thefirst file, an application used to open the first file. The applicationis, for example, referred to as a second application.

The first manager software may obtain a path of the soft link created inthe distributed file system of the mobile phone 100, and the firstmanager software may send the path of the soft link to the secondmanager software. In addition, the first manager software can alsoobtain the metadata of the file, for example, the type information ofthe file, and the first manager software may also send the obtainedmetadata of the file to the second manager software. The second managersoftware determines and invokes, based on the type information of thefile and the like, an application that can open the file. For example,the second manager software determines that the second application canopen the file.

For more content of S807, refer to the foregoing descriptions.

S808: The portable computer invokes the second application to open thefirst file.

The first file, that is, data of the first file is obtained from themobile phone 100 based on the metadata of the first file.

The portable computer invokes the second application, and the secondapplication opens the soft link based on the path of the soft link. Inthis case, the distributed file system of the portable computer mayobtain the first file from the mobile phone 100 based on the metadatacorresponding to the soft link. This may be understood as obtaining thedata of the first file from the mobile phone 100. For example, thedistributed file system of the portable computer may obtain the firstfile from the mobile phone 100 based on the storage path information ofthe first file included in the metadata corresponding to the soft link.Therefore, the second application can open the first file. In addition,the portable computer may further store the data of the first file inthe portable computer. For example, the portable computer may store thedata of the first file in a local file system of the portable computerby using the second application, for example, may store the data of thefirst file as a temporary file.

For an example in which the second manager software opens the firstfile, refer to any one of FIG. 4B to FIG. 4D.

For more content of S808, refer to the foregoing descriptions.

S809: The user edits the first file on the portable computer, and savesthe edited first file. The edited first file is, for example, referredto as a second file, or may also be referred to as an updated file. Aname of the file is not limited.

The user may view the first file on the portable computer, or mayperform an editing operation on the first file on the portable computer,for example, may delete content, add content, or modify content in thefirst file. After the user completes an operation on the first file, thefirst file may be saved. In this case, the portable computer may updatethe stored first file, or update the data of the first file, to obtainupdated data of the first file. The updated data of the first file maybe understood as the updated first file, that is, the second file.

For more content of S809, refer to the foregoing descriptions.

S810: The portable computer sends the second file to the mobile phone100, and the mobile phone 100 receives the second file from the portablecomputer.

The portable computer may send the second file to the mobile phone 100.For example, the portable computer may synchronize the second file tothe distributed file system of the mobile phone 100 by using thedistributed file system of the portable computer, so that the mobilephone 100 can use the second file to overwrite the first file stored ina local file system of the mobile phone. In this way, the first file isupdated. The portable computer may send the obtained second file to themobile phone 100 each time after the user updates the first file, sothat the first file can be updated in time on the mobile phone side.Alternatively, the portable computer may send the obtained second fileto the mobile phone 100 after the user closes the first file, to reducea quantity of times of sending updated data and reduce transmissionoverheads.

In addition, after the portable computer sends the second file to themobile phone 100, the portable computer may delete the stored secondfile to release storage space.

For more content of S810, refer to the foregoing descriptions.

S811: The user performs an operation on the mobile phone 100, and themobile phone 100 collects the operation of the user, and obtains eventinformation corresponding to the operation, or the mobile phone 100detects the event information corresponding to the operation. Forexample, the operation is referred to as a first operation, and themobile phone 100 may capture the first operation and obtain the eventinformation of the first operation. The first operation may be performedon a file icon. For example, the file icon is referred to as a firstfile icon, and the first file icon may belong to the at least one fileicon. That is, the user performs the first operation on the first fileicon on the first interface displayed on the mobile phone 100. The firstfile icon corresponds to one file, for example, the file is referred toas the first file.

The mobile phone 100 collecting (or detecting) the event information ofthe first operation of the user is equivalent to the mobile phone 100detecting the first operation performed on the first file icon.

For example, the first operation is a touch operation. For an example,refer to FIG. 5A. Alternatively, the first operation may be another typeof operation, for example, a gesture operation, a sound controloperation, or a floating operation. A purpose of performing the firstoperation by the user is to open the first file. Therefore, the firstoperation is an operation of opening the first file.

For more content of S811, refer to the foregoing descriptions.

S812: The mobile phone 100 determines that the event information of thefirst operation corresponds to the mobile phone 100. In other words, themobile phone 100 determines that the first operation is performed on themobile phone 100. In other words, the mobile phone 100 determines thatthe first operation (or the event information of the first operation) isperformed on the display of the mobile phone 100. In other words, themobile phone 100 determines that the file icon corresponding to thefirst operation is located on a display interface of the mobile phone100. That the first operation corresponds to the mobile phone 100 meansthat the first operation is an operation performed on the mobile phone100.

For example, after the first manager software obtains the eventinformation of the first operation, because the event information of thefirst operation includes an identifier of the mobile phone 100, thefirst manager software may determine that the event information of thefirst operation corresponds to the mobile phone 100, that is, determinesthat the second operation is an operation performed on the mobile phone100. In other words, the first manager software determines that a fileicon corresponding to the second operation is located on the displayinterface of the mobile phone 100. For example, the event information ofthe first operation indicates that the first operation is a touchoperation, and the first manager software may determine that the touchoperation is an operation performed on the display of the mobile phone100, or determine that the file icon corresponding to the touchoperation is located on the display interface of the mobile phone 100.

For more content of S812, refer to the foregoing descriptions.

S813: The mobile phone 100 determines that the file corresponding to theevent information of the first operation is the first file, or themobile phone 100 determines a storage path of the first filecorresponding to the event information of the first operation, or themobile phone 100 determines that the first operation corresponds to thefirst file.

For example, if the event information of the first operation includesabsolute position information of the first operation on the displayinterface of the mobile phone, the first manager software may determinea file such as the first file corresponding to the first operation basedon the position information of the first operation, or the first managersoftware may determine a storage path of the first file. The first fileis, for example, the file 3 described above.

For more content of S813, refer to the foregoing descriptions.

S814: The mobile phone 100 invokes a first application to open the firstfile.

For example, the first manager software may determine, based on a typeof the first file, an application that can open the first file, forexample, the first application.

For more content of S814, refer to the foregoing descriptions.

S815: The user edits the first file on the mobile phone 100, and savesthe edited first file. The edited first file is, for example, referredto as a second file.

For more content of S815, refer to the foregoing descriptions.

The user may view the first file on the mobile phone 100, or may performan editing operation on the first file on the mobile phone 100, forexample, may delete content, add content, or modify content in the firstfile. After the user completes an operation on the first file, the firstfile may be saved. In this case, the mobile phone 100 may update thefirst file stored in a memory, or update the data of the first file, toobtain updated data of the first file. The updated data of the firstfile may be understood as the updated first file, that is, the secondfile.

S802 to S810 and S811 to S815 are two parallel solutions, and may notoccur at the same time. For example, when the user performs anoperation, if the user chooses to perform the operation on the portablecomputer, S802 to S810 may be performed; if the user chooses to performan operation on the mobile phone 100, S811 to S815 may be performed.

For a same file in the first device, after the method provided in thisembodiment of this application is used, final experience effects of anoperation on the mobile phone 100 and an operation in a collaborationwindow (for example, a projection interface 202) mirrored by the mobilephone 100 to the portable computer are different. Even in a multi-screencollaboration scenario, the mobile phone 100 may intelligently select adevice (for example, the mobile phone 100 or the portable computer)based on a current focus of the user (for example, a device on which theoperation of the user is performed), to open, edit, and save acorresponding file, the user can complete office work without leaving orswitching the current focused screen, to provide better preview andediting experience for the user.

In the first file opening method, if the user performs an operation onthe mobile phone 100, the mobile phone 100 opens a corresponding file.Next, an embodiment of this application further provides a second fileopening method. In this method, if the user performs an operation on themobile phone 100, the mobile phone 100 may provide an option for theuser, and the user chooses to open a corresponding file on the mobilephone 100 or the portable computer. The second file opening methodprovided in this embodiment of this application may be used in amulti-screen collaboration scenario. For example, the method relates toa first device and a second device. For a structure of the first device,refer to FIG. 1 . Refer to FIG. 9A and FIG. 9B. The following describesa procedure of the method. For ease of understanding, in the followingdescription process, an example in which the first device is the mobilephone 100 and the second device is the portable computer is used.

S901: The mobile phone 100 and the portable computer enter amulti-screen collaboration mode in a preset manner.

For more content of S901, refer to the descriptions of S801 in theembodiment shown in FIG. 8A and FIG. 8B or the foregoing descriptions.

S902: The user performs an operation on the portable computer, and theportable computer collects the operation of the user and obtains eventinformation corresponding to the operation. For example, the operationis referred to as a first operation, and the portable computer maycapture the first operation and obtain the event information of thefirst operation. The first operation may be performed on a file icon.For example, the file icon is referred to as a first file icon, and thefirst file icon may belong to at least one file icon. That is, the userperforms the first operation on the first file icon on a first interfaceincluded in a second interface displayed on the portable computer. Thefirst file icon corresponds to one file, for example, the file isreferred to as a first file.

For more content of S902, refer to the descriptions of S802 in theembodiment shown in FIG. 8A and FIG. 8B or the foregoing descriptions.

S903: The portable computer sends the event information of the firstoperation to the mobile phone 100, and the mobile phone 100 receives theevent information of the first operation from the portable computer. Themobile phone 100 receiving the event information of the first operationmay also be equivalent to the mobile phone 100 detecting the operationperformed on the first file icon.

For more content of S903, refer to the descriptions of S803 in theembodiment shown in FIG. 8A and FIG. 8B or the foregoing descriptions.

S904: The mobile phone 100 determines that the event information of thefirst operation corresponds to the portable computer. In other words,the mobile phone 100 determines that the first operation is performed onthe portable computer. In other words, the mobile phone 100 determinesthat the first operation (or the event information of the firstoperation) is performed on a display of the portable computer. In otherwords, the mobile phone 100 determines that the file icon correspondingto the first operation is located on a display interface of the portablecomputer. That the first operation corresponds to the portable computermeans that the first operation is an operation performed on the portablecomputer.

For more content of S904, refer to the descriptions of S804 in theembodiment shown in FIG. 8A and FIG. 8B or the foregoing descriptions.

S905: The mobile phone 100 determines that the file corresponding to theevent information of the first operation is the first file, or themobile phone 100 determines a storage path of the first filecorresponding to the event information of the first operation, or themobile phone 100 determines that the first operation corresponds to thefirst file.

For more content of S905, refer to the descriptions of S805 in theembodiment shown in FIG. 8A and FIG. 8B or the foregoing descriptions.

S906: The mobile phone 100 sends metadata of the first file to theportable computer, and the portable computer receives the metadata ofthe first file from the mobile phone 100.

For more content of S906, refer to the descriptions of S806 in theembodiment shown in FIG. 8A and FIG. 8B or the foregoing descriptions.

S907: The portable computer determines, based on the metadata of thefirst file, an application used to open the first file. The applicationis, for example, referred to as a second application.

For more content of S907, refer to the descriptions of S807 in theembodiment shown in FIG. 8A and FIG. 8B or the foregoing descriptions.

S908: The portable computer invokes the second application to open thefirst file.

For more content of S908, refer to the descriptions of S808 in theembodiment shown in FIG. 8A and FIG. 8B or the foregoing descriptions.

S909: The user edits the first file on the portable computer, and savesthe edited first file. The edited first file is, for example, referredto as a second file, or may also be referred to as an updated file. Aname of the file is not limited.

For more content of S909, refer to the descriptions of S809 in theembodiment shown in FIG. 8A and FIG. 8B or the foregoing descriptions.

S910: The portable computer sends the second file to the mobile phone100, and the mobile phone 100 receives the second file from the portablecomputer.

For more content of S910, refer to the descriptions of S810 in theembodiment shown in FIG. 8A and FIG. 8B or the foregoing descriptions.

S911: The user performs an operation on the mobile phone 100, and themobile phone 100 collects information about the operation of the user,and obtains event information corresponding to the operation, or themobile phone 100 detects the event information corresponding to theoperation. For example, the operation is referred to as a firstoperation, and the mobile phone 100 may capture the first operation andobtain the event information of the first operation. The first operationmay be performed on a file icon. For example, the file icon is referredto as a first file icon, and the first file icon may belong to at leastone file icon. That is, the user performs the first operation on thefirst file icon on a first interface displayed on the mobile phone 100.The first file icon corresponds to one file, for example, the file isreferred to as a first file.

The mobile phone 100 collecting (or detecting) event information of thefirst operation of the user is equivalent to the mobile phone 100detecting the first operation performed on the first file icon.

For more content of S911, refer to the descriptions of S811 in theembodiment shown in FIG. 8A and FIG. 8B or the foregoing descriptions.

S912: The mobile phone 100 determines that the event information of thefirst operation corresponds to the mobile phone 100. In other words, themobile phone 100 determines that the first operation is performed on themobile phone 100. In other words, the mobile phone 100 determines thatthe first operation (or the event information of the first operation) isperformed on a display of the mobile phone 100. In other words, themobile phone 100 determines that the file icon corresponding to thefirst operation is located on a display interface of the mobile phone100.

For more content of S912, refer to the descriptions of S812 in theembodiment shown in FIG. 8A and FIG. 8B or the foregoing descriptions.

S913: The mobile phone 100 outputs prompt information, where the promptinformation is used to determine a device that is to open the firstfile.

For example, the mobile phone 100 may output the prompt information byusing the display 194. The prompt information may include one or moreoptions, and the one or more options may be used to determine a deviceon which the first file is to be opened. For an example of the promptinformation, refer to FIG. 7A or FIG. 7B.

For more content of S913, refer to the foregoing descriptions.

S914: The user selects a first option in the one or more options, andthe mobile phone 100 detects an operation of selecting the first option.

For example, still as shown in FIG. 7D, if the user touches an option“i” by using a finger, the touch sensor 180K may detect the operation,and may collect event information of the operation. After collecting theevent information of the operation, the touch sensor 180K may send theevent information of the operation to a first manager software. Afterreceiving the event information of the operation from the touch sensor180K, the first manager software determines that the user chooses toopen the first file on the mobile phone 100 by using an application 1corresponding to “i”.

For example, the first option corresponds to a first application, andfor example, the first application is installed on the mobile phone 100.

For more content of S914, refer to the foregoing descriptions.

S915: The mobile phone 100 determines that the file corresponding to theevent information of the first operation is the first file, or themobile phone 100 determines a storage path of the first filecorresponding to the event information of the first operation, or themobile phone 100 determines that the first operation corresponds to thefirst file.

For more content of S915, refer to the descriptions of S813 in theembodiment shown in FIG. 8A and FIG. 8B or the foregoing descriptions.

S916: The mobile phone 100 invokes a first application to open the firstfile.

For more content of S916, refer to the descriptions of S814 in theembodiment shown in FIG. 8A and FIG. 8B or the foregoing descriptions.

S917: The user edits the first file on the mobile phone 100, and savesthe edited first file. The edited first file is, for example, referredto as a second file.

For more content of S917, refer to the descriptions of S815 in theembodiment shown in FIG. 8A and FIG. 8B or the foregoing descriptions.

S918: The user selects a second option in the one or more optionsincluded in the prompt information, and the mobile phone 100 detects anoperation of selecting the second option.

For example, still as shown in FIG. 7B, if the user touches an option“Computer application” by using a finger, the touch sensor 180K maydetect the operation, and may collect event information of theoperation. After collecting the event information of the operation, thetouch sensor 180K may send the event information of the operation to thefirst manager software. After receiving the event information of theoperation from the touch sensor 180K, the first manager softwaredetermines that the user chooses to open the first file on the portablecomputer.

For more content of S918, refer to the foregoing descriptions.

After S918 is performed, S906 to S910 may continue to be performed.Details are not described again.

S902 to S910, and S911 to S918 and subsequent steps are two parallelsolutions, and may not occur at the same time. For example, when theuser performs an operation, if the user chooses to perform the operationon the portable computer, S902 to S910 may be performed; if the userchooses to perform an operation on the mobile phone 100, S911 to S918and subsequent steps may be performed. In addition, S914 to S917, andS918 and subsequent steps are also two parallel solutions, and may notoccur at the same time. For example, when the user performs an operationbased on the prompt information, if the user chooses to open the firstfile on the portable computer, S918 and subsequent steps may beperformed; if the user chooses to open the first file on the mobilephone 100, S914 to S917 may be performed.

For example, sometimes although the user performs an operation on themobile phone 100, the user actually expects to present a correspondingfile on the portable computer to another user for viewing. In thisscenario, according to the technical solution provided in thisembodiment of this application, the user may choose to open the file onthe portable computer, so as to complete a presentation process. It canbe learned that according to the technical solution provided in thisembodiment of this application, a selection opportunity is provided forthe user, and it is more convenient for the user to select a properdevice to open a corresponding file.

In the foregoing embodiments provided in this application, the methodprovided in embodiments of this application is described fromperspectives of the mobile phone 100 and the portable computer servingas execution bodies. To implement functions in the foregoing methodsprovided in embodiments of this application, the mobile device (forexample, the mobile phone 100 or the portable computer) may include ahardware structure and/or a software module, and implement the foregoingfunctions in a form of the hardware structure, the software module, or acombination of the hardware structure and the software module. Whether afunction in the foregoing functions is performed by using the hardwarestructure, the software module, or the combination of the hardwarestructure and the software module depends on particular applications anddesign constraints of the technical solutions.

As shown in FIG. 10 , some other embodiments of this applicationdisclose an electronic device. The electronic device is, for example, amobile phone (for example, a mobile phone 100), a Pad, or a portablecomputer. The electronic device may include: a touchscreen 1001, wherethe touchscreen 1001 includes a touch-sensitive surface 1006 and adisplay 1007; an application 1008; one or more processors 1002; and oneor more memories 1003, configured to store one or more programs 1004.The foregoing components may be connected through one or morecommunications buses 1005. The display 1007 may be configured to displaycontent of a file in the electronic device; or the display 1007 may befurther configured to display a desktop of the electronic device; or thedisplay 1007 may be configured to display an image, or the like.

When the one or more programs 1004 stored in the memory 1003 areexecuted by the one or more processors 1002, the electronic device maybe configured to perform steps in the embodiment shown in FIG. 8A andFIG. 8B, the embodiment shown in FIG. 9A and FIG. 9B, or anothercorresponding embodiment.

It should be noted that, in this embodiment of this application,division into the units is an example, and is merely a logical functiondivision. In actual implementation, another division manner may be used.Functional units in embodiments of the present invention may beintegrated into one processing unit, or each of the units may existalone physically, or two or more units are integrated into one unit. Forexample, in the foregoing embodiments, a first obtaining unit and asecond obtaining unit may be a same unit, or may be different units. Theintegrated unit may be implemented in a form of hardware, or may beimplemented in a form of a software function unit, or may be implementedin a form of a combination of hardware and a software function unit.

According to the context, the term “when” used in the foregoingembodiments may be interpreted as a meaning of “if”, “after”, “inresponse to determining”, or “in response to detecting”. Similarly,according to the context, the phrase “when it is determined that” or “if(a stated condition or event) is detected” may be interpreted as ameaning of “if determining” or “in response to determining” or “when (astated condition or event) is detected” or “in response to detecting (astated condition or event)”.

All or some of the foregoing embodiments may be implemented throughsoftware, hardware, firmware, or any combination thereof. When softwareis used to implement embodiments, embodiments may be implementedcompletely or partially in a form of a program product. The programproduct includes one or more computer instructions. When the programinstructions are loaded and executed on a computer, the procedure orfunctions according to embodiments of this application are all orpartially generated. The computer may be a general-purpose computer, aspecial-purpose computer, a computer network, or another programmabledevice. The computer instructions may be stored in the computer-readablestorage medium or may be transmitted from a computer-readable storagemedium to another computer-readable storage medium. For example, thecomputer instructions may be transmitted from a website, computer,server, or data center to another website, computer, server, or datacenter in a wired (for example, a coaxial cable, an optical fiber, or adigital subscriber line) or wireless (for example, infrared, radio, ormicrowave) manner. The computer-readable storage medium may be anyusable medium accessible by the computer, or a data storage device, forexample, a server or a data center, integrating one or more usablemedia. The usable medium may be a magnetic medium (for example, a floppydisk, a hard disk, or a magnetic tape), an optical medium (for example,a DVD), a semiconductor medium (for example, a solid-state drive), orthe like.

For a purpose of explanation, the foregoing description is describedwith reference to a specific embodiment. However, the foregoing examplediscussion is not intended to be detailed, and is not intended to limitthis application to a disclosed precise form. Based on the foregoingteaching content, many modification forms and variation forms arepossible. Embodiments are selected and described to fully illustrate theprinciples of this application and practical application of theprinciples, so that other persons skilled in the art can make full useof this application and various embodiments that have variousmodifications applicable to conceived specific usage.

In embodiments provided in this application, the method provided inembodiments of this application is described from a perspective in whicha terminal device is used as an execution body. To implement functionsin the foregoing method provided in embodiments of this application, theterminal device may include a hardware structure and/or a softwaremodule, and implement the foregoing functions in a form of the hardwarestructure, the software module, or a combination of the hardwarestructure and the software module. Whether a function in the foregoingfunctions is performed by using the hardware structure, the softwaremodule, or the combination of the hardware structure and the softwaremodule depends on particular applications and design constraints of thetechnical solutions.

1-11. (canceled)
 12. A method comprising: entering, by a first device, amulti-screen collaboration mode in a preset manner for performingmulti-screen collaboration with a second device that enters themulti-screen collaboration mode; displaying, by the first device, afirst interface, and projecting, by the first device, the firstinterface onto a second interface of the second device, wherein thefirst interface comprises a file icon, the second interface comprisesthe first interface, and a file corresponding to the file icon is storedin the first device; detecting, by the first device, an operationperformed on the file icon; determining, by the first device, that theoperation is performed on a display screen of the first device or adisplay screen of the second device; when the operation is performed onthe display screen of the first device, opening, by the first device,the file on the first device; and when the operation is performed on thedisplay screen of the second device, opening, by the first device, thefile on the second device.
 13. The method according to claim 12, whereinthe method further comprises: receiving, by the first device, an updatedfile of the file from the second device; and updating, by the firstdevice, the file with the updated file.
 14. The method according toclaim 12, wherein detecting, by the first device, the operationperformed on the file icon comprises: receiving, by the first device,event information from the second device, wherein the event informationindicates the operation, and the event information comprises anidentifier of the second device; or detecting, by the first device andon the first device, event information generated by the operation. 15.The method according to claim 14, wherein determining, by the firstdevice, that the operation is performed on the display screen of thesecond device comprises: determining, by the first device based on theidentifier of the second device, that the operation is performed on thedisplay screen of the second device.
 16. The method according to claim12, wherein when the operation is performed on the display screen of thesecond device, opening the file on the second device comprises: sending,by the first device, metadata of the file to the second device.
 17. Themethod according to claim 16, wherein sending, by the first device, themetadata of the file to the second device comprises: sending, by thefirst device, the metadata of the file to a distributed file system ofthe second device using a distributed file system of the first device.18. The method according to claim 16, wherein the metadata of the filecomprises storage path information of the file in the first device. 19.The method according to claim 18, wherein the metadata of the filefurther comprises one or more of following: type information of thefile, size information of the file, or a name of the file.
 20. Anelectronic device comprising: a display; one or more processors; and anon-transitory memory; and wherein the memory stores one or moreprograms, the one or more programs comprise instructions, and when theinstructions are executed by the electronic device, the electronicdevice is caused to perform following operations: entering amulti-screen collaboration mode in a preset manner for performingmulti-screen collaboration with a second device that enters themulti-screen collaboration mode; displaying a first interface on thedisplay, and projecting the first interface onto a second interface ofthe second device, wherein the first interface comprises a file icon,the second interface comprises the first interface, and a filecorresponding to the file icon is stored in the electronic device;detecting an operation performed on the file icon; determining that theoperation is performed on the display of the electronic device or adisplay screen of the second device; when the operation is performed onthe display screen of the electronic device, opening the file on theelectronic device; and when the operation is performed on the displayscreen of the second device, opening the file on the second device. 21.The electronic device according to claim 20, the operations furthercomprise: receiving an updated file of the file from the second device;and updating the file with the updated file.
 22. The electronic deviceaccording to claim 20, wherein detecting the operation performed on thefile icon comprises: receiving event information from the second device,wherein the event information indicates the operation, and the eventinformation comprises an identifier of the second device; or detecting,on the electronic device, event information generated by the operation.23. The electronic device according to claim 22, wherein determiningthat the operation is performed on the display screen of the seconddevice comprises: determining, based on the identifier of the seconddevice, that the operation is performed on the display screen of thesecond device.
 24. The electronic device according to claim 20, when theoperation is performed on the display screen of the second device,opening the file on the second device comprises: sending metadata of thefile to the second device.
 25. The electronic device according to claim24, wherein sending the metadata of the file to the second devicecomprises: sending the metadata of the file to a distributed file systemof the second device using a distributed file system of the electronicdevice.
 26. The electronic device according to claim 24, wherein themetadata of the file comprises storage path information of the file inthe electronic device.
 27. The electronic device according to claim 26,wherein the metadata of the file further comprises one or more offollowing: type information of the file, size information of the file,or a name of the file.
 28. A non-transitory computer-readable storagemedium storing a program, wherein when the program is run on anelectronic device, the electronic device is caused to perform followingoperations: entering a multi-screen collaboration mode in a presetmanner for performing multi-screen collaboration with a second devicethat enters the multi-screen collaboration mode; displaying a firstinterface, and projecting the first interface onto a second interface ofthe second device, wherein the first interface comprises a file icon,the second interface comprises the first interface, and a filecorresponding to the file icon is stored in the electronic device;detecting an operation performed on the file icon; determining that theoperation is performed on a display screen of the electronic device or adisplay screen of the second device; when the operation is performed onthe display screen of the electronic device, opening the file on theelectronic device; and when the operation is performed on the displayscreen of the second device, opening the file on the second device. 29.The computer-readable storage medium according to claim 28, theoperations further comprises: receiving an updated file of the file fromthe second device; and updating the file with the updated file.
 30. Thecomputer-readable storage medium according to claim 28, whereindetecting the operation performed on the file icon comprises: receivingevent information from the second device, wherein the event informationindicates the operation, and the event information comprises anidentifier of the second device; or detecting, on the electronic device,event information generated by the operation.
 31. The computer-readablestorage medium according to claim 30, wherein determining that theoperation is performed on the display screen of the second devicecomprises: determining, based on the identifier of the second device,that the operation is performed on the display screen of the seconddevice.